-
Notifications
You must be signed in to change notification settings - Fork 101
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
There is a way to hide resource properties? #87
Comments
Not really. There was a similar request in #36. We could include an analysis configuration (like Do you see a big advantage in make that controllable? If yes then we should incorporate that feature. |
So If you create dedicated pojos for each endpoint you will NOT benefit from this but If you reuse your JPA entities and mark undesired properties with @JsonIgnore for example, it would be nice to exclude them from swagger too. |
I've got it working here but it needs some changes. As JaxRS doesn't have any standard for ignoring properties I've added jackson-annotations to the project which doesn't bring any transitive dependencies. Then I've reworked JavaTypeAnalyzer to look for @JsonIgnore in analyze method. Here is the diff: http://www.diff-online.com/view/586277a8ed8ee The only thing I could not make was to read the annotation @JsonIgnoreProperties value here:
Any idea on how to read the annotation values? |
Ah ok, so I got it. Have you tried excluding the unwanted property with |
I like your approach, though the initial idea of the tool was to stay as close to the standards as possible -- and as soon as that works completely to go on from that with the most commonly used frameworks. What do you think? |
The main problem is that APIs using @JsonIgnore will have responses in swagger-ui that differs from what the API documentation is saying. What other frameworks se should handle? |
So @XmlTransient excludes de field from swagger definition BUT when I invoke the endpoint in swagger-ui the field is present in response because my JaxRS implementation (resteasy) doesn't take @XmlTransient into account. |
- adds tests for @JsonIgnore and @JsonIgnoreType
About @XmlTransient, RestEasy will not support it in favor of Jackson as stated here: https://issues.jboss.org/browse/WFLY-801 |
- changelog update
- removes wrong comment
JsonIgnore in superclass
In swagger-doclet we used @exclude javadoc annotation at resource/method or field level to remove a resource from generated swagger json.
There is a way to achieve that with this plugin?
The text was updated successfully, but these errors were encountered: