Open MarkusKull opened 9 years ago
thanks markus looks good, there are some people still using java 7 so im thinking about doing a version of this fix that doesnt use lamdas etc, the equals is used in the unit tests for checking expected vs actual, agree re immutable models though there is some hackiness where some fields needed to be updated post creation but il look to address that properly at some stage, i would rather fix the unit tests that have the multiple methods with same path and mimetypes than have the workaround.
I'll probably have time in some days to look into the unittests and get rid of the workaround.
BTW, due to settings of maven-compiler in parentpom (source=target=1.8) the generated classfiles can no longer be run under java7. If you still want java7, this should be changed.
Did now fix the invalid UnitTest-Resources by assigning distinct paths. Removed the workaround.
Ohh no, now the content-type
is only one, if you have application/json
and application/+1.json
only one will be show
@mageddo Could you explain some more, e.g. with a complete example?
application/json
and application/+1.json
sounds like different versions or structurally different models. Such different structures are neither supported by swagger-spec or newest swagger-ui.
Since some time ago, swagger-ui no longer displays methods having multiple differing return types. Only different produces-mimetypes with same return-type are supported. See https://github.com/swagger-api/swagger-spec/issues/146 or https://github.com/swagger-api/swagger-core/issues/521 .
Doclet can still support multiple java-methods (one java-method per mimetype) by combining them into one Swagger-Operation, which this PR does. Unfortunately some doclet-unittests declare multiple methods with same parameters and mimetypes (invalid according to JAX-RS). As quick workaround any methods without mimetypes are omitted by the merge.
BTW, it would be nice to get rid of the (unused?) hashcode and equals-methods in the models. Hashing doesnt work well for changeable objects. I would also prefer immutable objects and empty collections instead of null collections.