Open robfe opened 4 months ago
The idiomatic way to represent an enum where multiple values can be selected at once would be with the FlagsEnum attribute, as documented at https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-flagsattribute
This would simplify something like https://github.com/merge-api/merge-csharp-client/blob/main/src/Merge.Client/Ats/Jobs/Types/JobsListRequestExpand.cs to just
[JsonConverter(typeof(StringEnumFlagsSerializer<JobsListRequestExpand>))] [FlagsEnum] public enum JobsListRequestExpand { Departments, HiringManagers, JobPostings, Recruiters, Offices, }
Of course, you'd have to write StringEnumFlagsSerializer yourself as it's not built in. I'd be happy to help if it's a direction you want to take the library!
@robfe this would require some changes to Merge's OpenAPI spec as well. We'll chat with the merge team and come back to you here.
The idiomatic way to represent an enum where multiple values can be selected at once would be with the FlagsEnum attribute, as documented at https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-flagsattribute
This would simplify something like https://github.com/merge-api/merge-csharp-client/blob/main/src/Merge.Client/Ats/Jobs/Types/JobsListRequestExpand.cs to just
Of course, you'd have to write StringEnumFlagsSerializer yourself as it's not built in. I'd be happy to help if it's a direction you want to take the library!