Expose valid enum values as slice in Go SDKs #5512
Labels
feature
Requests for new features.
go
Pull requests that update Go code
product/sdk-generator
Fern's SDK Generator that outputs client libraries in 7 languages
Feature Description
We use enumerations in several places in the Polytomic API in order to guide users toward valid values. Fern exposes these as a Go type (great!), but doesn't provide a way to get the full set of valid values. For example, the
SyncMode
type defined here defines constants for each valid value, but doesn't define a way to get the set of valid values. This would be useful when building other tools to drive the API using the SDK.Proposed Generated Code (Optional)
Using the
SyncMode
example, I can imagine one of two approaches:The latter feels a tiny bit more useful, since it also allows us to describe the implementation as a generic interface:
(Maybe the method should be
ValidValues
orEnumValues
? I feel less invested in the spelling.)The text was updated successfully, but these errors were encountered: