You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the OpenAPI spec, the definitions with discriminator act as a base type and a union. We are modeling the base type fine by using #[serde(flatten)] in the children. The problem is we are not modeling the union. In Rust, we should have both types.
For naming, here are a couple of options.
Add a new type with a Union suffix.
Append Base to the existing base type.
I manually tried out both in the internal PR and I prefer adding a Union type, but open to discussion.
Using specification\vmware\resource-manager\Microsoft.AVS\stable\2022-05-01\vmware.json as example. The relevant models would be:
In the OpenAPI spec, the definitions with
discriminator
act as a base type and a union. We are modeling the base type fine by using#[serde(flatten)]
in the children. The problem is we are not modeling the union. In Rust, we should have both types.For naming, here are a couple of options.
Union
suffix.Base
to the existing base type.I manually tried out both in the internal PR and I prefer adding a
Union
type, but open to discussion.Using specification\vmware\resource-manager\Microsoft.AVS\stable\2022-05-01\vmware.json as example. The relevant models would be:
I'm not sure what to do about unknown union variants, but may be that can be a future step.
The text was updated successfully, but these errors were encountered: