Home Swagger annotation does not produce expected result
Reply: 0

Swagger annotation does not produce expected result

user954
1#
user954 Published in May 26, 2018, 11:33 pm

My team is using swagger annotation 1.5.14 to generate the swagger file for the documentation, when we define a string property with ApiModelProperty and example:

@ApiModelProperty(example="484799")
private String accountNumber;

This generates the output:

"accountNumber": 484799

Is it possible to make it generate the account number with example value double quoted:

"accountNumber": "484799"

Since it will be easier to tell between string value and number value when look at the example.

Following are we have tried so far:

  1. put the escape character for double quote (example = "\"484799\"")
  2. use dataType = "java.lang.String" with example parameter
  3. Leave extra space in the example value.

My environment: Java 1.8, swagger annotation 1.5.14, swagger 2

Thanks in advance

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312369 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO