feat(issues-2079): Implement JsonView support for swagger. #2662
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See original request #2079
The patch will create various definition models for response based on the original model and
the JsonView, e.g., given the original model Car, and JsonView named Detail and Summary, the
definition model could be Car_Summary, Car_Detail, or Car_Summary-or-Detail.
The patch also support the inheritance of the JsonView, e.g., The Detail is a subtype of Summary,
so any type/field annotated by Summary, should be visible to Detail view.
Please refer to the JsonViewTest.java for detail.
Also refer to the CarResource.java and the updated ApiListingResourceIT.java
The following swagger will be generated: