-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to generate versions enum in modular? #2680
Comments
prefer to generate KnownVersions and update the document link in ClientOptions. |
Can we just emit a fixed union and have users cast to any if they need to provide an unknown api version? export interface EdgeZonesClientOptionalParams extends ClientOptions {
/** The API version to use for this operation. */
apiVersion?: "2024-04-01-preview";
} |
@joheredi Personally I prefer here to generate as string and with document enhancement for knownable values. Let me know how you think of this! Firstly I'd like to clarify one thing here, there will be two concepts of api version,
Regarding the types these two versions are independent with each other but considering only one client-leve apiVesion case, we are talking about - if we could be smart to indicate the possible values for that parameter. I think a weak linkage between them would be better with following considerations:
|
Offline confired with Jose, we agreed to go with Option 2 - Generate as KnownVersions and link it to client option. |
This is from the discussion. With the case we have client-level api version defined.
Then we would generate
string
as client options. And also generating a fixed & orphan Versions enum from getAllModels with Usage.Version.This may not be proper because the api version is an extensible enum which allows customers to pass a list outside the enums.
To solve this we could either ignore this value or generate as extensible enum
Both are okay for me and personally i prefer generating as KnownVersions which could help suggest values in client side.
The text was updated successfully, but these errors were encountered: