-
-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: deprecate
options
possibly being null (#2387)
## Description Deprecates `options` nullable type for `Model` classes. This reduces complexity and streamlines it with the `$serializationContext`. ## What type of PR is this? (check all applicable) - [ ] Bug Fix - [ ] Feature - [x] Refactor - [x] Deprecation - [ ] Breaking Change - [ ] Documentation Update - [ ] CI ## Checklist - [ ] I have made corresponding changes to the documentation (`docs/`) - [x] I have made corresponding changes to the changelog (`CHANGELOG.md`)
- Loading branch information
1 parent
0dcdc7d
commit c431718
Showing
13 changed files
with
176 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the NelmioApiDocBundle package. | ||
* | ||
* (c) Nelmio | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nelmio\ApiDocBundle\Tests\Functional\Controller; | ||
|
||
use Nelmio\ApiDocBundle\Attribute\Model; | ||
use Nelmio\ApiDocBundle\Tests\Functional\Entity\Article81; | ||
use OpenApi\Attributes as OA; | ||
use Symfony\Component\HttpFoundation\JsonResponse; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
class DeprecationController | ||
{ | ||
#[Route(path: '/legacy/null_options', name: 'legacy_null_options', methods: 'POST')] | ||
#[OA\Response( | ||
response: 200, | ||
description: 'Legacy null options', | ||
content: new Model(type: Article81::class, options: null), | ||
)] | ||
public function __invoke(Article81 $requestDTO): JsonResponse | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"title": "", | ||
"version": "0.0.0" | ||
}, | ||
"paths": { | ||
"/legacy/null_options": { | ||
"post": { | ||
"operationId": "post_legacy_null_options", | ||
"responses": { | ||
"200": { | ||
"description": "Legacy null options", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Article81" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Article81": { | ||
"required": [ | ||
"id", | ||
"type", | ||
"intBackedType", | ||
"notBackedType" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "integer" | ||
}, | ||
"type": { | ||
"$ref": "#/components/schemas/ArticleType81" | ||
}, | ||
"intBackedType": { | ||
"$ref": "#/components/schemas/ArticleType81IntBacked" | ||
}, | ||
"notBackedType": { | ||
"$ref": "#/components/schemas/ArticleType81NotBacked" | ||
}, | ||
"nullableType": { | ||
"nullable": true, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/components/schemas/ArticleType81" | ||
} | ||
] | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"ArticleType81": { | ||
"type": "string", | ||
"enum": [ | ||
"draft", | ||
"final" | ||
] | ||
}, | ||
"ArticleType81IntBacked": { | ||
"type": "integer", | ||
"enum": [ | ||
0, | ||
1 | ||
] | ||
}, | ||
"ArticleType81NotBacked": { | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters