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 · 3 comments

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! 🙏

@DominicLuidold
Copy link
Contributor Author

@DjordyKoert Sorry to bother/ping you 🙈

Do you also see this being a part of this bundle?

This question is more or less blocking potential work on this issue. How do you see this?

@DjordyKoert
Copy link
Collaborator

DjordyKoert commented Dec 10, 2024

Sorry I am quite busy lately.

I would be happy to have this although I would prefer to keep the name as #[Ignore] instead of #[IgnoreFromSchema]

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

2 participants