java - How to declare a type being a list of entries in Swagger -


I want to declare a type of area "manually" to be a list of entries in Swagger.

Assume that I have completely custom

  apply the list of public class MyCustomList & lt; MyValue & gt; {....}  

Now I have an ideal class

  @ data public class MyModel {public MyCustomList problematic field; }  

I understand that there is a list (array) of MyCustomList MyValue . In

@ApiOperation I was set

  @ApiOperation (value = "..", response = MyValue.class, responseContainer = "list ")  

I believe you complete it with custom model converter You can. See here:

For a guide to manually change the sections, But in short, it looks like this:

  import com.wordnik.swagger .converter. *; String "jasonString =" {"+" \ "id \": \ "date \", "+" \ "attribute": {"+" \ "value \": {"+" \ "required \": true, "+" \ "Description \": \ "Date ISO -08601 Format \", "+" \ "Notes \": \ "Add Any Notes You Want Here \", "+" \ "Type \": \ "String \", "+" \ "format \": \ "date-time \" "+"} "+"} "+"} "; Override converter converter = new override converter (); Converter.ed ("java.util.Date", jsonString); ModelConverters.addConverter (converter, true);  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -