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.
As I posted at https://groups.google.com/forum/#!topic/swagger-swaggersocket/FfJ3dJetmEA
In 1.5.0, io.swagger.jackson.ModelResolver is the default ModelConverter that analyse the bean structure. In the
public Model resolve(JavaType type, ModelConverterContext context, Iterator next) method around lines 263-280, there is a block of code to determine whether the field is readOnly as follows.
Note that propDef.getSetter() would throw exception if there are overloading setters. However, overloaded setters are very useful, and we want to keep them.
Consider a user case that we already implemented Apis with JaxRS, and would like to add swagger-jaxRS annotations to generate swagger.json using the bottom-up approach. Our data model contains more than one setters for some fields (overload setters), and uur Api uses Gson or customized serialization tools (not use jackson) to handle the serialization/deserialization of the data model without any problem. However, request swagger.json would fail because jackson throws conflict setters exception and io.swagger.jackson.ModelResolver does not suppress the exception.
It would be very useful it io.swagger.jackson.ModelResolver added try-catch block on if (propDef.getSetter() == null) to suppress the exception.