[constants] Brainstorm for how we should deal with a required, extensible enum of 1, with no client default
See original GitHub issueLong title, but repeating here: what do you guys think we should do when we encounter when we have an extensible enum of 1 that is a required parameter for a function and it does not have an x-ms-client-default
specified in the swagger?
My 2 cents after talking with @lmazuel (thanks for your help!): m4 should set the x-ms-client-default
to the single enum value.
Potential drawbacks: the main drawback to this is that if an enum gets added (which it can get added, because it’s an extensible enum), it could be breaking. However, if they add an x-ms-client-default
with the original default value to the swagger, the change would not be breaking.
Conclusion (on my and @lmazuel 's side): since it’s easy to make it not breaking, and since as a customer it’s cumbersome to have to specify a parameter that really only has one possible value, m4 should make the one possible value the parameter’s x-ms-client-default
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Thanks for looking into this! Let’s discuss this issue at the AutoRest meeting today to see if we can come up with a reasonable solution.
@daviwil sorry for the late reply, I stopped counting after ~25 examples, and I just made my way to around apimanagement, so I think there are a lot of cases that already have this.
I don’t think in this case it’s enough to catch more of these from entering the specs repo since there are so many already in existence, and I think it’s too much work to add
x-ms-default
s for the existing cases.Here’s some examples: