Is there is a way to merge enums into one flat enum, or list?
See original GitHub issueI am using the 2.0 spec and I have a field which I am using in a model as well as a path param where the value can be from one of three different enums. Using the syntax below is turning into an array with 3 enums. However, I would like it to be one flat enum. Is there any way to achieve this?
Thanks so much:
properties:
type:
type: "string"
enum:
- *unitTypes
- *componentTypes
- *snootTypes
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Java 8 how to merge multiple lists by enum type
You can use Collectors.toMap . Map by ResourcesStatus and merge two StatusSummary with count field in merge-function for the same ...
Read more >Merge TypeScript Enums
There is no native support for merging 2 or more enums in typescript but its possible with a combination of type aliases and...
Read more >11 Enumerations
Identifies one way enumerations, i. e., enumerations that can map only from the natural numbers to values that satisfy the enumeration's contract, but...
Read more >Enum — Elixir v1.13.4
Returns a list of results of invoking fun on every nth element of enumerable , starting with the first element. map_intersperse(enumerable, separator, mapper)....
Read more >Enum in TypeScript
Numeric enums can include members with computed numeric value. The value of an enum member can be either a constant or computed. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
YAML does not support this.
In OpenAPI 3.0 this can probably be handled using
oneOf
:Yes. In 3.0, all parameters use a
schema
, so the syntax would be similar to models:Correct.
oneOf
is a new feature in 3.0.