Open Xtansia opened 3 hours ago
What are your thoughts @dblock @nhtruong?
We could potentially re-use the oneOf
concept like was used for deprecated enums and combine it with the title
property:
GeoOrientation:
oneOf:
- title: left
type: string
enum:
- left
- LEFT
- clockwise
- cw
- title: right
type: string
enum:
- right
- RIGHT
- counterclockwise
- ccw
Is your feature request related to a problem?
There are enums that OpenSearch accepts where multiple string representations map to the same value, with one being the canonical representation (i.e. they're aliased).
Example: Current spec of
GeoOrientation
:Implementation of
Orientation
in OpenSearch:Existing implementation of
GeoOrientation
in opensearch-java (on serialization first item is used, all accepted for deserialization):Note that we also handle all-caps variants as if OpenSearch itself sets and returns its version it will be uppercase.
This means the final spec should be roughly equivalent to:
But should also communicate that
left
andright
are the canonical versions and others map onto them.