okta-sdk-dotnet
okta-sdk-dotnet copied to clipboard
Ditch StringEnum
Describe the feature request?
Serializers have the the ability to convert Enums to strings. There is no need for StringEnum and in fact it gets in the way of doing what would normally be possible with regular Enums like:
expected.Status = userStatus switch
{
UserStatus.STAGED => UserProfileStatus.STAGED,
UserStatus.PROVISIONED => UserProfileStatus.PROVISIONED
};
In the example here I'm unit testing with DTOs that have a different type than what the Okta SDK returns.
The above results in the compile error:
A constant value is expected
New or Affected Resource(s)
UserStatus at the least
Provide a documentation link
No response
Additional Information?
No response
Hi @rcollette ,
Thanks for your feedback. The reason we use StringEnums is to avoid runtime errors if the API adds new values that haven't been impacted into the SDK yet. That being said, we have plans in the future to revisit enums but not in the short term.