Skip to content

Releases: api-platform/core

Version 2.5.0 beta 1

17 Sep 14:47
v2.5.0-beta.1
30b9caa
Compare
Choose a tag to compare
Version 2.5.0 beta 1 Pre-release
Pre-release
  • Add an HTTP client dedicated to functional API testing (#2608)
  • Add PATCH support (#2895)
  • Add a command to generate json schemas api:json-schema:generate (#2996)
  • Add infrastructure to generate a JSON Schema from a Resource ApiPlatform\Core\JsonSchema\SchemaFactoryInterface (#2983)
  • Replaces access_control by security and adds a security_post_denormalize attribute (#2992)
  • Add basic infrastructure for cursor-based pagination (#2532)
  • Change ExistsFilter syntax to exists[property], old syntax still supported see #2243, fixes it's behavior on GraphQL (also related #2640).
  • Pagination with subresources (#2698)
  • Improve search filter id's managment (#1844)
  • Add support of name converter in filters (#2751, #2897), filter signature in abstract methods has changed see b42dfd1
  • Ability to change the Vary header via cacheHeaders attributes of a resource (#2758)
  • Ability to use the Query object in a paginator (#2493)
  • Compatibility with Symfony 4.3 (#2784)
  • Better handling of JsonSerializable classes (#2921)
  • Elasticsearch: Add pagination (#2919)
  • Add default, min, max specification in pagination parameter API docs (#3002)
  • Add a swagger version configuration option swagger.versions and deprecates the enable_swagger configuration option (#2998)
  • Order filter now documents asc/desc as enum (#2971)
  • GraphQL: BC Break Separate query resource operation attribute into item_query and collection_query operations so user can use different security and serialization groups for them (#2944, #3015)
  • GraphQL: Add support for custom queries and mutations (#2447)
  • GraphQL: Add support for custom types
  • GraphQL: Better pagination support (backwards pagination) (#2142)
  • GraphQL: Support the pagination per resource
  • GraphQL: Add the concept of stages in the workflow of the resolvers and add the possibility to disable them with operation attributes (#2959)
  • GraphQL: Add GraphQL Playground besides GraphiQL and add the possibility to change the default IDE (or to disable it) for the GraphQL endpoint
  • GraphQL: Add a command to print the schema in SDL api:graphql:export > schema.graphql (#2600)
  • GraphQL: Improve serialization performance by avoiding calls to the serialize PHP function
  • GraphQL: Allow to use a search and an exist filter on the same resource
  • GraphQL: Refactor the architecture of the whole system to allow the decoration of useful services (TypeConverter to manage custom types, SerializerContextBuilder to modify the (de)serialization context dynamically, etc.)

Notes:

Please read #2825 if you have issues with the behavior of Readable/Writable Link

Version 2.4.7

17 Sep 14:47
v2.4.7
5379326
Compare
Choose a tag to compare
  • Fix passing context to data persisters' remove method
  • Ensure OpenAPI normalizers properly expose the date format
  • Add source maps for Swagger UI
  • Improve error message when filter class is not imported
  • Add missing autowiring alias for Pagination
  • Doctrine: ensure that EntityManagerInterface is used in data providers

Version 2.4.6

20 Aug 07:30
v2.4.6
96bfc4d
Compare
Choose a tag to compare
  • GraphQL: Use correct resource configuration for filter arguments of nested collection
  • Swagger UI: compatibility with Internet Explorer 11
  • Varnish: Prevent cache miss by generating IRI for child related resources
  • Messenger: Unwrap exception thrown in handler for Symfony Messenger 4.3
  • Fix remaining Symfony 4.3 deprecation notices
  • Prevent cloning non clonable objects in previous_data
  • Return a 415 HTTP status code instead of a 406 one when a faulty Content-Type is sent
  • Fix WriteListener trying to generate IRI for non-resources
  • Allow to extract blank values from composite identifier

Version 2.4.5

22 Jun 10:50
v2.4.5
e056f5d
Compare
Choose a tag to compare
  • Fix denormalization of a constructor argument which is a collection of non-resources
  • Allow custom operations to return a different class than the expected resource class

Version 2.4.4

13 Jun 07:04
v2.4.4
076e008
Compare
Choose a tag to compare
  • Store the original data in the previous_data request attribute, and allow to access it in security expressions using the previous_object variable (useful for PUT and PATCH requests)
  • Fix resource inheritance handling
  • Fix BC break in AbstractItemNormalizer introduced in 2.4
  • Fix serialization when using interface as resource
  • Basic compatibility with Symfony 4.3

Version 2.4.3

16 May 17:04
v2.4.3
e0eba21
Compare
Choose a tag to compare
  • Doctrine: allow autowiring of filter classes

  • Doctrine: don't use fetchJoinCollection on Paginator when not needed

  • Doctrine: fix a BC break in OrderFilter

  • GraphQL: input objects aren't nullable anymore (compliance with the Relay spec)

  • Cache: Remove some useless purges

  • Mercure: publish to Mercure using the default response format

  • Mercure: use the Serializer context

  • OpenAPI: fix documentation of the PropertyFilter

  • OpenAPI: fix generation of the servers block (also fixes the compatibility with Postman)

  • OpenAPI: skip not readable and not writable properties from the spec

  • OpenAPI: add the id path parameter for POST item operation

  • Serializer: add support for Symfony Serializer's @SerializedName metadata

  • Metadata: ApiResource's attributes property now defaults to null, as expected

  • Metadata: Fix identifier support when using an interface as resource class

  • Metadata: the HTTP method is now always uppercased

  • Allow to disable listeners per operation (fix handling of empty request content)

    Previously, empty request content was allowed for any POST and PUT operations. This was an unsafe assumption which caused other problems.

    If you wish to allow empty request content, please add "deserialize"=false to the operation's attributes. For example:

    <?php
    // api/src/Entity/Book.php
    
    use ApiPlatform\Core\Annotation\ApiResource;
    use App\Controller\PublishBookAction;
    
    /**
     * @ApiResource(
     *     itemOperations={
     *         "put_publish"={
     *             "method"="PUT",
     *             "path"="/books/{id}/publish",
     *             "controller"=PublishBookAction::class,
     *             "deserialize"=false,
     *         },
     *     },
     * )
     */
    class Book
    {

    You may also need to add "validate"=false if the controller result is null (possibly because you don't need to persist the resource).

  • Return the 204 HTTP status code when the output class is set to null

  • Be more resilient when normalizing non-resource objects

  • Replace the data request attribute by the return of the data persister

  • Fix error message in identifiers extractor

  • Improve the bundle's default configuration when using symfony/symfony is required

  • Fix the use of MetadataAwareNameConverter when available (configuring name_converter: serializer.name_converter.metadata_aware will now result in a circular reference error)

Version 2.4.2

29 Mar 01:30
v2.4.2
76a47b7
Compare
Choose a tag to compare
  • Fix a dependency injection injection problem in FilterEagerLoadingExtension
  • Improve performance by adding a NoOpScalarNormalizer handling scalar values

Version 2.4.1

26 Mar 18:55
v2.4.1
Compare
Choose a tag to compare
  • Improve performance of the dev environment and deprecate the api_platform.metadata_cache parameter
  • Fix a BC break in SearchFilter
  • Don't send HTTP cache headers for unsuccessful responses
  • GraphQL: parse input and messenger metadata on the GraphQl operation
  • GraphQL: do not enable graphql when webonyx/graphql-php is not installed

Version 2.4.0

22 Mar 11:13
v2.4.0
294afdc
Compare
Choose a tag to compare

See the announcement on Kévin's blog for a curated list of the changes.

  • Listeners are now opt-in when not handling API Platform operations
  • DISTINCT is not used when there are no joins
  • Preserve manual join in FilterEagerLoadingExtension
  • The elasticsearch attribute can be disabled resource-wise or per-operation
  • The messenger attribute can now take the input string as a value (messenger="input"). This will use a default transformer so that the given input is directly sent to the messenger handler.
  • The messenger attribute can be declared per-operation
  • Mercure updates are now published after the Doctrine flush event instead of on kernel.terminate, so the Mercure and the Messenger integration can be used together
  • Use Symfony's MetadataAwareNameConverter when available
  • Change the extension's priorities (<0) for improved compatibility with Symfony's autoconfiguration feature. If you have custom extensions we recommend to use positive priorities.
Service name Priority Class
api_platform.doctrine.orm.query_extension.eager_loading (collection) -8 ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\EagerLoadingExtension
api_platform.doctrine.orm.query_extension.eager_loading (item) -8 ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\EagerLoadingExtension
api_platform.doctrine.orm.query_extension.filter -16 ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\FilterExtension
api_platform.doctrine.orm.query_extension.filter_eager_loading -17 ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\FilterEagerLoadingExtension
api_platform.doctrine.orm.query_extension.order -32 ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\OrderExtension
api_platform.doctrine.orm.query_extension.pagination -64 ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\PaginationExtension
  • Fix JSON-LD contexts when using output classes
  • GraphQl: Fix pagination (the endCursor behavior was wrong)
  • GraphQl: Improve output/input behavior
  • GraphQl: Improve mutations (make the clientMutationId nullable and return mutation payload as an object)
  • MongoDB: Fix search filter when searching by related collection id
  • MongoDB: Fix numeric and range filters

Version 2.4.0 beta 2

26 Feb 17:36
v2.4.0-beta.2
Compare
Choose a tag to compare
Version 2.4.0 beta 2 Pre-release
Pre-release
  • Fix version constraints for Doctrine MongoDB ODM
  • Respect _api_respond request attribute in the SerializeListener
  • Change the normalizer's priorities (< 0). If you have custom normalizer we recommend to use positive priorities.
Service name Priority Class
api_platform.hydra.normalizer.constraint_violation_list -780 ApiPlatform\Core\Hydra\Serializer\ConstraintViolationListNormalizer
api_platform.jsonapi.normalizer.constraint_violation_list -780 ApiPlatform\Core\JsonApi\Serializer\ConstraintViolationListNormalizer
api_platform.problem.normalizer.constraint_violation_list -780 ApiPlatform\Core\Problem\Serializer\ConstraintViolationListNormalizer
api_platform.swagger.normalizer.api_gateway -780 ApiPlatform\Core\Swagger\Serializer\ApiGatewayNormalizer
api_platform.hal.normalizer.collection -790 ApiPlatform\Core\Hal\Serializer\CollectionNormalizer
api_platform.hydra.normalizer.collection_filters -790 ApiPlatform\Core\Hydra\Serializer\CollectionFiltersNormalizer
api_platform.jsonapi.normalizer.collection -790 ApiPlatform\Core\JsonApi\Serializer\CollectionNormalizer
api_platform.jsonapi.normalizer.error -790 ApiPlatform\Core\JsonApi\Serializer\ErrorNormalizer
api_platform.hal.normalizer.entrypoint -800 ApiPlatform\Core\Hal\Serializer\EntrypointNormalizer
api_platform.hydra.normalizer.documentation -800 ApiPlatform\Core\Hydra\Serializer\DocumentationNormalizer
api_platform.hydra.normalizer.entrypoint -800 ApiPlatform\Core\Hydra\Serializer\EntrypointNormalizer
api_platform.hydra.normalizer.error -800 ApiPlatform\Core\Hydra\Serializer\ErrorNormalizer
api_platform.jsonapi.normalizer.entrypoint -800 ApiPlatform\Core\JsonApi\Serializer\EntrypointNormalizer
api_platform.problem.normalizer.error -810 ApiPlatform\Core\Problem\Serializer\ErrorNormalizer
serializer.normalizer.json_serializable -900 Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer
serializer.normalizer.datetime -910 Symfony\Component\Serializer\Normalizer\DateTimeNormalizer
serializer.normalizer.constraint_violation_list -915 Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer
serializer.normalizer.dateinterval -915 Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer
serializer.normalizer.data_uri -920 Symfony\Component\Serializer\Normalizer\DataUriNormalizer
api_platform.graphql.normalizer.item -922 ApiPlatform\Core\GraphQl\Serializer\ItemNormalizer
api_platform.hal.normalizer.item -922 ApiPlatform\Core\Hal\Serializer\ItemNormalizer
api_platform.jsonapi.normalizer.item -922 ApiPlatform\Core\JsonApi\Serializer\ItemNormalizer
api_platform.jsonld.normalizer.item -922 ApiPlatform\Core\JsonLd\Serializer\ItemNormalizer
api_platform.serializer.normalizer.item -923 ApiPlatform\Core\Serializer\ItemNormalizer
serializer.normalizer.object -1000 Symfony\Component\Serializer\Normalizer\ObjectNormalizer
  • Allow custom stylesheets to be appended or replaced in the swagger UI
  • Load messenger only if available
  • Fix missing metadata cache pool for Elasticsearch
  • Make use of the new AdvancedNameConverterInterface interface for name converters
  • Refactor input/output attributes, where these attributes now take:
    • an array specifying a class and some specific attributes (name and iri if needed)
    • a string representing the class
    • a falsy boolean to disable the input/output
  • Introduce the DataTransformer concept to transform an input/output from/to a resource
  • Api Platform normalizer is not limited to Resources anymore (you can use DTO as relations and more...)
  • MongoDB: allow a 0 limit in the pagination
  • Fix support of a discriminator mapping in an entity