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

Include field in schema but hide from examples #1823

Open
Ulrar opened this issue Jun 9, 2024 · 0 comments
Open

Include field in schema but hide from examples #1823

Ulrar opened this issue Jun 9, 2024 · 0 comments

Comments

@Ulrar
Copy link

Ulrar commented Jun 9, 2024

Is your feature request related to a problem? Please describe.
I'd like to be able to keep specific fields in a struct as part of the schema, but hide / omit them from the generated examples.

Describe the solution you'd like
Either have an explicit tag swaggerhide: true, or maybe just some logic to hide the field if the field's example tag is empty and json has omitempty ? Just a couple of ideas.

Describe alternatives you've considered
For now I just swaggerignore, but that hides it from the schema too which isn't ideal.

Additional context
This would allow technically documenting fields we have to support, without broadcasting their existence which could drive up their usage.

Apologies if that exists and I missed it, I did search and I also posted here.

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

No branches or pull requests

1 participant