Skip to content

Add deprecation support for Hydra #1977

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 2 commits into from
May 27, 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 n/a

Follows #1976 and #1962. Add the owl:deprecated annotation to deprecated operations and supportedProperties.

namespace App\Entity;

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

/**
 * @ApiResource(deprecationReason="This resource is deprecated")
 */
class DeprecatedResource
{
    public $id;

    /**
     * @ApiProperty(deprecationReason="This field is deprecated")
     */
    public $deprecatedField;
}

Unlike GraphQL, OWL and Hydra don't support deprecation messages.

@dunglas dunglas merged commit 9a3e6e2 into api-platform:master May 27, 2018
@dunglas dunglas deleted the hydra-deprecated branch May 27, 2018 08:28
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