Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed swagger_definition_name to openapi_definition_name #1740

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ Note: as your route is not exposed, you may want to return a HTTP 404 if it's ca

API Platform generates a definition name based on the serializer `groups` defined
in the (`de`)`normalizationContext`. It's possible to override the name
thanks to the `swagger_definition_name` option:
thanks to the `openapi_definition_name` option:

```php
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Post;

#[ApiResource]
#[Post(denormalizationContext: ['groups' => ['user:read'], 'swagger_definition_name' => 'Read'])]
#[Post(denormalizationContext: ['groups' => ['user:read'], 'openapi_definition_name' => 'Read'])]
class User
{
// ...
Expand All @@ -342,7 +342,7 @@ class User
{
const API_WRITE = [
'groups' => ['user:read'],
'swagger_definition_name' => 'Read',
'openapi_definition_name' => 'Read',
];
}
```
Expand Down