Open Kordonme opened 5 years ago
Can you also post the produced swagger spec?
I'd say the output is as expected... you need to change the parameter type to array of this enum not array of any
The swagger is generated from C#
public List<UserRole> IncludedUserRoles { get; set; }
With what do you generate the spec?
It should be:
"type": "array",
"items": {
"$ref": "#/definitions/UserRole"
},
Can you do that? Maybe with an operation filter/processor?
I have an enum like this:
When generating a TypeScript client, the parameters in the method is generated as
includedUserRoles: any[]
and therefore the it's being treated as anObjectArray
. See the template on these lines.This results in a wrong URL:
IncludedUserRoles[0].0=R&IncludedUserRoles[0].1=o&IncludedUserRoles[0].2=l&IncludedUserRoles[0].3=e&IncludedUserRoles[0].4=1
Expected output is simply
IncludedUserRoles=Role1
.Is this related to Swagger generation or array handling in NSwag?