-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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!
Metadata
Metadata
Assignees
Labels
No labels