There is an entity with a field
cises:
type: array
description: An array of brands. The length must match the value of the quantity field, or the array must be empty
items:
type: string
Code java
@SerializedName("cises")
private List<String> cises = null;
How to use swagger codegen to set an empty list by default, instead of null
There is an open issue with the swagger codegen ignoring the default: [] for array. See [JAVA] Empty array not getting picked as default for the defined model in Open API AKA Swagger generated code for more information.
It's suggested to use required as a workaround for now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With