Skip to content

Add deprecation support in Swagger #1976

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

Merged
merged 1 commit into from
May 24, 2018

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented May 24, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR todo

Follows #1962. Add the deprecated flag to operations that can be applied to deprecated resources:

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;

/**
 * @ApiResource(deprecationReason="This resource is deprecated")
 */
class DeprecatedResource
{
  // ...
}

Unfortunately, unlike GraphQL, Open API v2 doesn't support fields deprecation, or deprecation messages. Open API v3 supports fields deprecation, but API Platform don't have support for this version yet (help welcome)!

@dunglas dunglas force-pushed the swagger-deprecated branch from db1f326 to 0ecba8c Compare May 24, 2018 16:21
@dunglas dunglas merged commit 7e1d63c into api-platform:master May 24, 2018
@dunglas dunglas deleted the swagger-deprecated branch May 24, 2018 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant