- Issue created by @pdureau
Following
β¨
[2.0.0-alpha3] EnumPropType: Labelled enumerations
Fixed
and the introduction of meta:enum
We need to cover this syntax too:
props:
type: object
properties:
position:
anyOf:
- { "const": "top", "title": "Top"}
- { "const": "bottom", "title": "Secondary"}
A bit more verbose and complicated, but JSON schema native and compliant.
We can do it in SchemaManager/Canonicalizer
If anyOf
of oneOf
is found, and every value is a const
or an enum
with only one item
, we transform it to:
{
"type": ["string", "number", "integer"],
"enum": [...],
"meta:enum": {...}
}
However, we may need to split Canonicalizer::canonicalize() into 2 public methods:
Active
2.0
Code