#[MapRequestPayload] & #[MapUploadedFile] combined on same route (#2689) (4ff48e7)SplObjectStorage::detach() is deprecated since 8.5, use method SplObjectStorage::offsetUnset() instead (94f6895)Model::$type from property-info to type-info Type (ef14213)Added support for Symfony's TranslatableInterface
Fixed a bug where using abstract controllers would ignore various attributes like #[OA\Tag] & #[Security] on child classes
Made it possible to automatically generate security definitions based on the #[IsGranted] attribute.
nelmio_api_doc:
# ...
areas:
default:
security:
MyBearerScheme:
type: 'http'
scheme: 'bearer'
Made it possible to configure how operation ids are generated.
nelmio_api_doc:
operation_id_generation: always_prepend
Possible values: always_prepend, conditionally_prepend, no_prepend or enum instance of Nelmio\ApiDocBundle\Describer\OperationIdGeneration
#[Ignore] attribute that allows a property to be excluded from the generated schema.<?php
use Nelmio\ApiDocBundle\Attribute\Ignore;
class Foo
{
#[Ignore]
private string $ignoredProperty;
}
#[MapUploadedFile] symfony controller argument attributevalue with a list of strings to the Areas annotation/attribute is deprecated. Pass the list of strings directly.-#[Areas(properties: ['value' => ['foo', 'bar']])]
+#[Areas(properties: ['foo', 'bar'])]
-#[Areas(['value' => ['foo', 'bar']])]
+#[Areas(['foo', 'bar'])]
with_annotation has been deprecated in favor of with_attributenelmio_api_doc:
areas:
path_patterns:
- ^/api/foo
- with_annotation: true
+ with_attribute: true
nelmio_api_doc:
type_info: true
$context to PropertyDescriberInterface::supports()null type from $options in Nelmio\ApiDocBundle\Attribute\Model::__construct(). Pass an empty array ([]) instead.null type from $options in NNelmio\ApiDocBundle\Attribute\Model::__construct(). Pass an empty array ([]) instead.5.18.1 to 5.18.22.2.04.33.25.18.1#[OA\Property] being overwrittenNelmio\ApiDocBundle\Annotation namespace in favor of Nelmio\ApiDocBundle\Attribute namespace in preparation for 5.x. Consider upgrading to the new attribute syntax.- use Nelmio\ApiDocBundle\Annotation\Areas;
- use Nelmio\ApiDocBundle\Annotation\Model;
- use Nelmio\ApiDocBundle\Annotation\Operation;
- use Nelmio\ApiDocBundle\Annotation\Security;
+ use Nelmio\ApiDocBundle\Attribute\Areas;
+ use Nelmio\ApiDocBundle\Attribute\Model;
+ use Nelmio\ApiDocBundle\Attribute\Operation;
+ use Nelmio\ApiDocBundle\Attribute\Security;
options and serializationContext via nelmio_api_doc.models.names.serializationContext not being applied to nested models.useJms in the serializationContext.
#[OA\Response(response: 200, content: new Model(type: UserDto::class, serializationContext: ["useJms" => false]))]
nelmio_api_doc:
html_config:
assets_mode: bundle
redocly_config:
expandResponses: '200,201'
hideDownloadButton: true
swagger_ui_config:
deepLinking: true
DocumentationExtension::getExtendedType() has been deprecated in favor of DocumentationExtension::getExtendedTypes() to align with the deprecation introduced with symfony/symfony version 4.2.#[\JMS\Serializer\Annotation\Discriminator(field: 'type', map: ['car' => Car::class, 'plane' => Plane::class])]
abstract class Vehicle { }
class Car extends Vehicle { }
class Plane extends Vehicle { }
/**
* [@var](https://github.com/var) int<6, 11>
* [@var](https://github.com/var) int<min, 11>
* [@var](https://github.com/var) int<6, max>
* [@var](https://github.com/var) positive-int
* [@var](https://github.com/var) negative-int
*/
will be interpreted as appropriate minimum and maximum properties in the generated OpenAPI specification.Dropped support for PHP 7.2 and PHP 7.3. PHP 7.4 is the minimum required version now.
nelmio_api_doc.cache.item_id now automatically gets the area appended.
nelmio_api_doc:
cache:
pool: app.cache
item_id: nelmio_api_doc.docs
areas:
default:
...
area1:
...
Result in cache keys: nelmio_api_doc.docs.default & nelmio_api_doc.docs.area1 to be used respectively.nelmio_api_doc:
areas:
default: # Manual cache configuration
cache:
pool: app.cache
item_id: nelmio_api_doc.docs.default
...
area1:
cache:
pool: app.cache
item_id: nelmio_api_doc.docs.area1
...
Non-configured options will be inherited from nelmio_api_doc.cache.x-*) from configuration not being outputted in the generated specification.
nelmio_api_doc:
documentation:
info:
title: 'My API'
description: 'My API description'
x-foo: 'bar'
Now results in JSON specification:
{
...
"info": {
"title": "API",
"version": "1.0",
"x-foo": "bar"
},
...
}
oneOf instead of allOf.Updated bundle directory structure to recommended file structure as described in https://symfony.com/doc/7.0/bundles/best_practices.html.
It might be necessary to reinstall the assets:
bin/console assets:install
If your codebase mentions a file or directory by path then an update to this path is necessary. For example to following configuration:
doc-api:
resource: "[@NelmioApiDocBundle](https://github.com/NelmioApiDocBundle)/Resources/config/routing/swaggerui.xml"
prefix: /api/doc
Becomes:
doc-api:
resource: "[@NelmioApiDocBundle](https://github.com/NelmioApiDocBundle)/config/routing/swaggerui.xml"
prefix: /api/doc
nelmio_api_doc.cache.pool and nelmio_api_doc.cache.item_id.
nelmio_api_doc:
cache:
pool: app.cache
item_id: nelmio_api_doc.docs
PropertyDescriberInterface::describe() via the $groups parameter is deprecated, the parameter will get removed in a future version. Pass groups via $context['groups'] instead.[@SerializedName](https://github.com/SerializedName) annotation support and name converters when using Symfony >= 4.2.[@SWG](https://github.com/SWG) annotations support at methods level in modelsUsage of Google Fonts was removed. System fonts serif / sans will be used instead.
This can lead to a different look on different operating systems.
You can re-add Google Fonts again manually by overriding the template.
The Twig template for the Swagger UI now contains blocks to make it easier to overwrite certain parts. See the official documentation how to do this.
Add a documentation form extension. Use the documentation option to define how a form field is documented.
Allow references to config definitions in controllers.
Using [@Model](https://github.com/Model) implicitly in [@SWG](https://github.com/SWG)\Schema, [@SWG](https://github.com/SWG)\Items and [@SWG](https://github.com/SWG)\Property is deprecated. Use ref=[@Model](https://github.com/Model)() instead.
Before:
/**
* This was considered as an array of models.
*
* [@SWG](https://github.com/SWG)\Property([@Model](https://github.com/Model)(type=FooClass::class))
*/
After:
/**
* For an individual object:
* [@SWG](https://github.com/SWG)\Property(ref=[@Model](https://github.com/Model)(type=FooClass::class))
*
* For an array:
* [@SWG](https://github.com/SWG)\Property(type="array", [@SWG](https://github.com/SWG)\Items(ref=[@Model](https://github.com/Model)(type=FooClass::class)))
*/
Config
nelmio_api_doc.areas added support to filter by host patterns.
nelmio_api_doc:
areas: [ host_patterns: [ ^api\. ] ]
Added dependency for "symfony/options-resolver:^3.4.4|^4.0"
Symfony Forms
JMS Serializer
int (alias for integer)SwaggerPHP
enum and default properties from SwaggerPHP annotation[@Security](https://github.com/Security) annotationsConfig
nelmio_api_doc.routes has been replaced by nelmio_api_doc.areas. Please update your config accordingly.
Before:
nelmio_api_doc:
routes: [ path_patterns: [ /api ] ]
After:
nelmio_api_doc:
areas: [ path_patterns: [ /api ] ]
Large refactoring introducing zircote/swagger-php for swagger annotations.
See UPGRADE-3.0.md for upgrading instructions.
How can I help you explore Laravel packages today?