fern icon indicating copy to clipboard operation
fern copied to clipboard

feat(csharp): Add forward compatible enums using a string enum

Open Swimburger opened this issue 1 year ago • 5 comments

  • Add IStringEnum as an interface
  • Generate string enums for all enums
  • Add StringEnumSerializer
  • Rename existing StringEnumSerializer to EnumSerializer
  • Add feature flag to opt-out of the new enum 'enable-forward-compatible-enums'
  • Update C# model and SDK version
  • Add tests for old and new serializer

Swimburger avatar Oct 02 '24 17:10 Swimburger

I assume we want to enable forward-compatible enums by default, so I coded it that way. Is there a way to change existing users' generator files so we can set it to false for them? Or should I make it false by default?

Swimburger avatar Oct 02 '24 17:10 Swimburger

I did not test whether the old enum serializer still works. I did test the new enum serializer manually. Is there a way to include tests for our serializer?

Swimburger avatar Oct 02 '24 17:10 Swimburger

I assume we want to enable forward-compatible enums by default, so I coded it that way. Is there a way to change existing users' generator files so we can set it to false for them? Or should I make it false by default?

We'll want to release a minor version where it is set to false and then a major version where we swap the default. Automating these config upgrades is something we want to do and @armandobelardo is thinking about

dsinghvi avatar Oct 02 '24 17:10 dsinghvi

🌿 Preview your docs: https://fern-preview-ad2190d1-a4ee-467a-b6e9-6d8367bc690d.docs.buildwithfern.com/learn

github-actions[bot] avatar Oct 02 '24 17:10 github-actions[bot]

I did not test whether the old enum serializer still works. I did test the new enum serializer manually. Is there a way to include tests for our serializer?

One option is to include an enum serializer test in the generated SDK itself and have that run as part of the CI test process in the SDK

dsinghvi avatar Oct 02 '24 17:10 dsinghvi

All feedback should be addressed now.

Swimburger avatar Oct 04 '24 23:10 Swimburger

I reseeded with latest from main

Swimburger avatar Oct 30 '24 17:10 Swimburger