ryankennedy / swagger-jaxrs-doclet

Apache License 2.0
87 stars 136 forks source link

Support Jackson @JsonView filtering on return types #43

Open frankgrimes97 opened 11 years ago

frankgrimes97 commented 11 years ago

We often define a single structure but return subsets of its fields from different JAX-RS resource methods by annotating the methods with @JsonView. (FYI, we're actually using Dropwizard)

e.g. http://jira.codehaus.org/browse/JACKSON-578

Would it be possible for the generated swagger documentation to only include those fields which are included in the specified JsonView?

cviebig commented 10 years ago

There is a workaround implemented in the carmapublic fork allowing you to override the type for documentation puposes. See https://github.com/ryankennedy/swagger-jaxrs-doclet/issues/63. In our project we have extended it to support interfaces too, as we are using Interfaces for jsonviews to leverage multiple inheritance.

conorroche commented 10 years ago

@cviebig ive just committed support for json view to https://github.com/Carma-Public/swagger-jaxrs-doclet ive added a test fixture for it too that uses interfaces and classes for the view classes based on the Person example in the original jackson ticket. let me know if its ok for you.