You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jason Wheadon (JIRA)" <ji...@apache.org> on 2015/10/13 23:57:05 UTC

[jira] [Updated] (CAMEL-9220) Model schema not including nested objects

     [ https://issues.apache.org/jira/browse/CAMEL-9220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Wheadon updated CAMEL-9220:
---------------------------------
    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:

{code:title=SomeRequest.java|borderStyle=solid}
@ApiModel
public class SomeRequest {
    @ApiModelProperty
    private List<SomeObject> someObjects;
    ...
}
{code}

{code:title=SomeObject.java|borderStyle=solid}
@ApiModel
public class SomeObject {
    @ApiModelProperty
    private String somePropertyOne;
    @ApiModelProperty
    private String somePropertyTwo;
    ...
}
{code}

Should have a model in swagger of:
{code:none}
{ 
  "someObjects": [ 
    { 
      "somePropertyOne": "", 
      "somePropertyTwo": "" 
    } 
  ] 
}
{code}

But instead has:
{code:none}
{ 
  "someObjects": [ 
    "SomeObject" 
  ] 
}
{code}

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.

  was:
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:

@ApiModel
public class SomeRequest {
    @ApiModelProperty
    private List<SomeObject> someObjects;
    ...
}

@ApiModel
public class SomeObject {
    @ApiModelProperty
    private String somePropertyOne;
    @ApiModelProperty
    private String somePropertyTwo;
    ...
}

Should have a model in swagger of:
{ 
  "someObjects": [ 
    { 
      "someObjectPropertyOne": "", 
      "someObjectPropertyTwo": "" 
    } 
  ] 
} 

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.


> Model schema not including nested objects
> -----------------------------------------
>
>                 Key: CAMEL-9220
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9220
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-swagger
>    Affects Versions: 2.16.0
>            Reporter: Jason Wheadon
>
> 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:
> {code:title=SomeRequest.java|borderStyle=solid}
> @ApiModel
> public class SomeRequest {
>     @ApiModelProperty
>     private List<SomeObject> someObjects;
>     ...
> }
> {code}
> {code:title=SomeObject.java|borderStyle=solid}
> @ApiModel
> public class SomeObject {
>     @ApiModelProperty
>     private String somePropertyOne;
>     @ApiModelProperty
>     private String somePropertyTwo;
>     ...
> }
> {code}
> Should have a model in swagger of:
> {code:none}
> { 
>   "someObjects": [ 
>     { 
>       "somePropertyOne": "", 
>       "somePropertyTwo": "" 
>     } 
>   ] 
> }
> {code}
> But instead has:
> {code:none}
> { 
>   "someObjects": [ 
>     "SomeObject" 
>   ] 
> }
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)