camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Wheadon (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-9220) Model schema not including nested objects
Date Tue, 13 Oct 2015 21:57:05 GMT

     [ 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)

Mime
View raw message