[REQ][Java] support anyOf Enum
See original GitHub issue3GPP R15 has defined a set of standards in the form of OpenAPI specification files.
The files are often lengthy and consist of oneOf, anyOf, allOf keywords.
The following definition that combines anyOf
with enum
has been consistently poping up and it will break the openapi-generator
RequestTrigger:
anyOf:
- type: string
enum:
- LOC_CH
- PRA_CH
- SERV_AREA_CH
- RFSP_CH
- ALLOWED_NSSAI_CH
- UE_AMBR_CH
The issue has been raised in #798 The solution was just workaround the spec files.
However it would be nice if we can instead add an option to the generator to simply ignore the anyOf
. Ideally we want the generator to work without any alteration to the spec files.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Adding Support for Enums in oneOf and anyOf in Java SDKs
Java SDKs now support enum types defined as oneOf/anyOf types. You can define as many distinct enum types as required with this support....
Read more >Validations for Enum Types - Baeldung
Learn how to build validations for enums using Java custom annotations. ... enumClass(); String message() default "must be any of enum ...
Read more >Mocking Java enum to add a value to test fail case
Here is a complete example. The code is almost like your original (just simplified better test validation): public enum MyEnum {A, B} public...
Read more >Enums - Swagger
Enums. You can use the enum keyword to specify possible values of a request parameter or a model property. For example, the sort...
Read more >Enum in Java - DigitalOcean
Technical tutorials, Q&A, events — This is an inclusive place where developers can find or lend support and discover new ways to contribute ......
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 Free
Top 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
I’ll be making a PR to address
anyOf
+enum
described in this ticket soon. I am also facing a separate issues cause byoneOf
here. I will create another ticket to track that.@lwlee2608 ,
I see ignoreAnyOfInEnum flag is mentioned in openapi generators document as config. Also i see PR changes are present in master.
But when i am trying to work with openapi generator 5.4.0 version , AnyOf tag is not getting ignored. Do you see other way ( like changes no present on 5.4.0 version?
I even tried to work with 5.0.0 , but there were issues in generated code like import was missing , in the generated code.
Help highly appreciated !!