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

All properties for all schemas became Deprecated #1607

Open
antonrinas opened this issue Jun 19, 2024 · 1 comment
Open

All properties for all schemas became Deprecated #1607

antonrinas opened this issue Jun 19, 2024 · 1 comment
Labels

Comments

@antonrinas
Copy link

antonrinas commented Jun 19, 2024

Screenshot from 2024-06-19 15-32-33
I noted that from some moment, all properties for certain schemas were marked as Deprecated.

I found the reason. Before the Schema description, I also have some class annotations. Within these annotations, one of the class properties is marked as @deprecated. In this case, all properties in the Schema after doc generation are marked as deprecated.

/**
 * @property int $id
 * ...
 * @property int $general_id @deprecated
 * ...
 */
#[OA\Schema(
    schema: 'Client',
    title: 'Client',
    description: 'Client',
    properties: [
        new OA\Property(property: 'id', description: 'ID', type: 'integer'),
        ...
    ]
)]
class ClientRecord {
...

For now, as a temporary decision, I marked all properties as deprecated: false.

new OA\Property(property: 'id', description: 'ID', type: 'integer', deprecated: false),
@antonrinas antonrinas changed the title All properties for all schema became Deprecated All properties for all schemas became Deprecated Jun 19, 2024
@DerManoMann
Copy link
Collaborator

I think this is a problem with how you use @deprecated? The tag applies to the associated structural element - in this case the schema.

https://docs.phpdoc.org/guide/references/phpdoc/tags/deprecated.html
The @deprecated tag declares that the associated Structural Element(s) will be removed in a future version...

https://phpstan.org/writing-php-code/phpdocs-basics#deprecations
Use @deprecated tag to mark declarations as deprecated:...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants