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 almost all cases, I think anyOf can be rewritten as a oneOf definition without a discriminator. And when it cannot be rewritten as a oneOf definition it must have a discriminator to break the tie. In fact, Pulumi's own schema for a property TypeSpec doesn't have a provision to bind an anyOf definition. It supports a oneOf (line number may change in the future) though with an optional discriminator.
Especially in the case where an API uses anyOf to provide an enum type as well as a plain string to allow users to pass in custom values, I think these can be safely rewritten as oneOf without a discriminator. Because a discriminator is not needed there and the value of such a type can only be one of the enum values or a plain string value anyway but not more than one at the same time.
I've closed this for the time being as wontfix because it is not safe for pulschema to assume that allanyOf definitions can be treated as oneOf. So this is something that the provider code that uses pulschema to make the decision before calling it.
See #129 (comment).
The text was updated successfully, but these errors were encountered: