-
Notifications
You must be signed in to change notification settings - Fork 258
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
add AutoRust support for x-ms-enum modelAsString #768
Comments
I looked at this a while back and concluded that it wasn't possible with the standard serde features, and that we'd probably need to generate explicit serializer/deserializer code. See this serde issue for details: However, I just looked again, and found the Questions:
|
Bah... I just implemented this, only to find that:
|
Think I'll try replacing That will fix my
Any alternative suggestions welcome. I haven't yet checked whether any of these clash with existing enum values! I guess |
#769 used |
#413 is for x-ms-enum in general, but this is specifically
modelAsString
support. When an enumeration is markes as"modelAsString": true
, it is extensible.Currently, the
cargo run --package azure_mgmt_compute --example vm_list
example fails for me because one of my VMs is a size not in the enum.An snippet from a spec:
Microsoft.Compute\stable\2021-11-01\compute.json
The generated code looks like this:
We need a way to deserialize and deserialize other string values using serde.
The text was updated successfully, but these errors were encountered: