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

[Feature]: Easy way to ignore properties from schema generation without relying on Symfony's #[Ignore] attribute #2306

Open
DominicLuidold opened this issue Jun 24, 2024 · 1 comment

Comments

@DominicLuidold
Copy link
Contributor

DominicLuidold commented Jun 24, 2024

Description

In several of our projects, our DTOs often times contain properties that (for different reasons) should be exluded from the generated schema. It would be great to have an easy way, e.g. a Nelmio #[IgnoreFromSchema] attribute, to ignore those properties.

Possible solutions not working for us:

  • Excluding specific properties using Symfony's #[Ignore] attribute as this leads to unintended side effects in other places where the serializer is used
  • Applying the #[OA\Property(readOnly: true)] property as this still includes the property in the request body schema for a POST endpoint, for example

Additional context

/

@DominicLuidold DominicLuidold changed the title [Feature]: Optionally exclude route parameters from request body schema automatically [Feature]: Easy way to ignore properties from schema generation without relying on Symfony's #[Ignore] attribute Jun 24, 2024
@DominicLuidold
Copy link
Contributor Author

DominicLuidold commented Aug 20, 2024

@DjordyKoert Judging by the 👍 on this issue, others seem to be interested in/need this feature as well.

Do you also see this being a part of this bundle? If so, could you give me a hint where I could start implementing it? Thanks! 🙏

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

No branches or pull requests

1 participant