I used SpringFox library for rest documentation of my spring boot app. When I click on model , all the elements are being returned as optional. Is there a way to display required elements as mandatory? Is there any additional configuration that needs to be added?
Yes by default All the fields will be optional. To mark a field as required you can use following annotation.
@ApiModelProperty(required = true)
On the getter method of the field which should be required. This won't show the field as "mandatory". But the optional tag will be removed for this field in the documentation.
Hope this helps.