You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Get query that takes an enum string type as a parameter, is not serializing into the correct value. Instead, it is being serialized to the Enum name not the EnumMember value
In the below example, PetStatusFilter will return title case Available or Pending or Sold. whereas it should return available or pending or sold
/pet/findByStatusWithFilter:
get:
tags:
- petsummary: Finds Pets by statusdescription: Multiple status values can be provided with comma separated stringsoperationId: findPetsByStatusWithFilterparameters:
- name: statusin: querydescription: Status values that need to be considered for filterrequired: trueschema:
type: arrayitems:
$ref: '#/components/schemas/PetStatusFilter'PetStatusFilter:
type: stringenum:
- available
- pending
- sold
openapi-generator version
5.4
main
Generation Details
The method in ClientUtils , ParameterToString does not check if obj is an Enum, and will default return obj.ToString().
Instead, it should be looking at the Enum's EnumMember attribute fo the value to return.
Steps to reproduce
Run generator ./bin/generate-sample.sh ./bin/configs/csharp with a modified version of the petstore.yaml including the above changes.
Related issues/PRs
None found
Suggest a fix
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
A Get query that takes an enum string type as a parameter, is not serializing into the correct value. Instead, it is being serialized to the
Enum name
not theEnumMember value
In the below example, PetStatusFilter will return title case
Available
orPending
orSold
. whereas it should returnavailable
orpending
orsold
openapi-generator version
Generation Details
The method in ClientUtils , ParameterToString does not check if obj is an Enum, and will default return obj.ToString().
Instead, it should be looking at the Enum's EnumMember attribute fo the value to return.
Steps to reproduce
Run generator
./bin/generate-sample.sh ./bin/configs/csharp
with a modified version of the petstore.yaml including the above changes.Related issues/PRs
None found
Suggest a fix
The text was updated successfully, but these errors were encountered: