swagger-angular-generator
swagger-angular-generator copied to clipboard
required:true is not respected for array fields
I have this parameter in my swagger.json
. required
is set to false
"parameters":[
{
"name":"token_types",
"in":"query",
"description":"Token types",
"required":false,
"type":"array",
"items":{
"type":"string",
"enum":[
"option_a",
"option_b",
"option_c",
]
}
}
],
if generates this typescript code:
const queryParamBase = {
token_types: params.token_types.join(','),
};
I have to specify an empty list, when generating the parameters. But it optional, so I expect that it`s fine to not set it in the params