Generating with attribute example in swagger.json
Hello,
when trying to generate JAX-RS 2.0 code (based on swagger 2.0) it fails as soon as in the definitions part of swagger file an attribute "example" is used. The attribute example itself works fine when using the swagger editor.
"Gateway": {
"properties": {
"gatewayId": {
"type": "string",
"description": "The unique id of abc."
}
},
"example": {
"gatewayId": "abc"
}
},
I used swagger-codegen-distribution-2.1.2-M1.jar Any idea?
Do you get an error message? Please share it if so and if possible, grab the 2.1.3-SNAPSHOT from sonatype or the develop_2.0 branch
This is the error message: Can not deserialize instance of java.lang.String out of START_OBJECT token at [Source: N/A; line: -1, column: -1](through reference chain: com.wordnik.sw agger.models.ModelImpl["example"]) (through reference chain: com.wordnik.swagger .models.Swagger["definitions"]) reading from test/in/swagger.json Can not deserialize instance of java.lang.String out of START_OBJECT token at [Source: N/A; line: -1, column: -1](through reference chain: com.wordnik.sw agger.models.ModelImpl["example"]) (through reference chain: com.wordnik.swagger .models.Swagger["definitions"])
I will try the snapshot later.
Thanks, will add a test for this and see about getting it fixed.
I tried to reproduce this bug from both master and develop_2.0 branches with this json sample but it works fine. Could you please tell me where to reproduce this bug?
confirmed fixed in develop.