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
Post a Comment