The server component of API Platform: hypermedia and GraphQL APIs in minutes
MIT License
Published by dunglas about 5 years ago
api:json-schema:generate
(#2996)ApiPlatform\Core\JsonSchema\SchemaFactoryInterface
(#2983)access_control
by security
and adds a security_post_denormalize
attribute (#2992)exists[property]
, old syntax still supported see #2243, fixes it's behavior on GraphQL (also related #2640).cacheHeaders
attributes of a resource (#2758)swagger.versions
and deprecates the enable_swagger
configuration option (#2998)asc
/desc
as enum (#2971)query
resource operation attribute into item_query
and collection_query
operations so user can use different security and serialization groups for them (#2944, #3015)api:graphql:export > schema.graphql
(#2600)serialize
PHP functionTypeConverter
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
Published by dunglas about 5 years ago
remove
methodPagination
EntityManagerInterface
is used in data providersPublished by dunglas about 5 years ago
previous_data
Content-Type
is sentWriteListener
trying to generate IRI for non-resourcesPublished by dunglas over 5 years ago
Published by dunglas over 5 years ago
previous_data
request attribute, and allow to access it in security expressions using the previous_object
variable (useful for PUT and PATCH requests)AbstractItemNormalizer
introduced in 2.4Published by dunglas over 5 years ago
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)
Published by dunglas over 5 years ago
FilterEagerLoadingExtension
NoOpScalarNormalizer
handling scalar valuesPublished by dunglas over 5 years ago
api_platform.metadata_cache
parameterSearchFilter
webonyx/graphql-php
is not installedPublished by dunglas over 5 years ago
See the announcement on Kévin's blog for a curated list of the changes.
DISTINCT
is not used when there are no joinselasticsearch
attribute can be disabled resource-wise or per-operationmessenger
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.messenger
attribute can be declared per-operationkernel.terminate
, so the Mercure and the Messenger integration can be used together<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 |
endCursor
behavior was wrong)clientMutationId
nullable and return mutation payload as an object)Published by dunglas over 5 years ago
_api_respond
request attribute in the SerializeListener< 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 |
name
and iri
if needed)falsy
boolean to disable the input/output0
limit in the paginationPublished by dunglas almost 6 years ago
See https://dunglas.fr/2019/01/api-platform-2-4/
Full changelog:
input_class
and output_class
attributesinput_class
and output_class
to falsecache_headers
attributestatus
attributeSunset
HTTP header using the sunset
attributeContent-Location
and Location
headers when appropriate for better RFC7231 conformanceapi_persist
request attribute to enable or disable the WriteListener
OptimisticLockException
is thrownRequestAttributesExtractor
is not internal anymore and can be used in userland codeshow_webby
configuration option to hide the spider in API docsPublished by dunglas almost 6 years ago
Published by dunglas almost 6 years ago
webonyx/graphql-php
0.13properties[]
as a collection parameterproperties[]
filterItemNormalizer
when $context['resource_class']
is not definedPublished by dunglas almost 6 years ago
DEFERRED_EXPLICIT
change tracking policyInvalidArgumentException
when trying to get an item from a collection routeroute_prefix
attribute in subresourcesNumericFilter
ReadListener
by adding the previous exceptionPublished by dunglas about 6 years ago
Published by dunglas about 6 years ago
_id
when id
is not part of the requested fieldsPublished by dunglas about 6 years ago
OrderFilter
when applied on nested entitiesPublished by dunglas over 6 years ago
@ApiResource
and @ApiProperty
annotationsaccess_control_message
attribute--output
option to the api:swagger:export
commandCacheableSupportsMethodInterface
introduced in Symfony 4.1 in all (de)normalizers (improves the performance dramatically)totalCount
field in GraphQL paginated collectionsPublished by dunglas over 6 years ago
ExistsFilter
for inverse side of OneToOne associationPublished by dunglas over 6 years ago
@ApiResource
and @ApiProperty
annotationsaccess_control_message
attribute--output
option to the api:swagger:export
commandCacheableSupportsMethodInterface
introduced in Symfony 4.1 in all (de)normalizers (improves the performance dramatically)totalCount
field in GraphQL paginated collections