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

Support swaggerignore field tag in structs for fields that should not be shown in swagger docs #632

Closed
larrycinnabar opened this issue Feb 26, 2020 · 6 comments

Comments

@larrycinnabar
Copy link

It's allowed to specify format, binding, swaggertype, etc tags to the struct fields.

But it's very useful to just ignore the field for swagger docs. It's a basic practice when you have fields in the model that are filled internally, not from frontend. So documentation just do not need to know about them

@sdghchj
Copy link
Member

sdghchj commented Feb 27, 2020

json:"-" not work ?

@larrycinnabar
Copy link
Author

json:"-" will make swagger to ignore the field, right. But I do need the json tag on that field.
Json tag - is json tag, swagger tags - are just about documentation.

@sdghchj
Copy link
Member

sdghchj commented Feb 27, 2020

OK, PR is welcome

@larrycinnabar
Copy link
Author

ok

@sdghchj
Copy link
Member

sdghchj commented Mar 14, 2020

Try master branch

@Xiaocge
Copy link

Xiaocge commented Mar 27, 2020

When will swaggerignore release.

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

3 participants