StructuralSchemaRewriter
fails for #[serde(untagged)]
enums of unit enums
#1622
Labels
bug
Something isn't working
Current and expected behavior
Sometimes you want to write an enum that adds more specific options to an otherwise generic enum. For example:
However, schemars doesn't support variant-level
#[serde(untagged)]
(GREsau/schemars#222). One alternative is to break out the new options to a separate enum, like so:However, this generates the following schema:
which isn't structural.
Possible solution
The structuralizer should recognize that we can safely merge these
anyOf
variants, into:Additional context
No response
Environment
Client Version: v1.30.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.31.0+k3s1
Configuration and features
Affected crates
kube-core
Would you like to work on fixing this bug?
None
The text was updated successfully, but these errors were encountered: