Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.16.0
-
None
-
Unknown
Description
This issue relates to the new camel-swagger-java component and not the camel-swagger component. JIRA is not yet updated for the new camel-swagger-java component.
When there are nested objects in the Api model for swagger, they are not being represented correctly in the model schema. See below for an example:
SomeRequest.java
@ApiModel public class SomeRequest { @ApiModelProperty private List<SomeObject> someObjects; ... }
SomeObject.java
@ApiModel public class SomeObject { @ApiModelProperty private String somePropertyOne; @ApiModelProperty private String somePropertyTwo; ... }
Should have a model in swagger of:
{ "someObjects": [ { "somePropertyOne": "", "somePropertyTwo": "" } ] }
But instead has:
{ "someObjects": [ "SomeObject" ] }
This model is invalid and makes the swagger documentation useless as no one knows what the request model is supposed to be.
Note: this worked correctly on camel 2.15.3 with the scala based camel-swagger component.