Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ][Java] support anyOf Enum #4491

Closed
lwlee2608 opened this issue Nov 14, 2019 · 6 comments · Fixed by #4498
Closed

[REQ][Java] support anyOf Enum #4491

lwlee2608 opened this issue Nov 14, 2019 · 6 comments · Fixed by #4498

Comments

@lwlee2608
Copy link
Contributor

3GPP 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.

@davinchia
Copy link

davinchia commented Nov 14, 2019

We are running into the same problem with the oneOf keyword for Java/Spring code generation. Any idea when this will be prioritised/worked on? We like that api-generator is active and worked on, compared to swagger-codegen, but incomplete features such as this, that swagger-codegen possesses, are making us hesitate. We are happy to help out with this issue if we receive some general guidance e.g. general approach/which files to work on etc. Thanks!

@lwlee2608
Copy link
Contributor Author

I'll be making a PR to address anyOf + enum described in this ticket soon.
I am also facing a separate issues cause by oneOf here. I will create another ticket to track that.

@davinchia
Copy link

@lwlee2608 that's great news! looking forward to being able to use this!

@pradhanv
Copy link

Is the "ignoreAnyOfInEnum" fix available in openapi-generator-cli-4.3.1.jar?
The command - "java -jar openapi-generator-cli-4.3.1.jar config-help -g spring" does not appear to list the "ignoreAnyOfInEnum" config option.

@lwlee2608
Copy link
Contributor Author

Is the "ignoreAnyOfInEnum" fix available in openapi-generator-cli-4.3.1.jar?
The command - "java -jar openapi-generator-cli-4.3.1.jar config-help -g spring" does not appear to list the "ignoreAnyOfInEnum" config option.

It's only available in 5.0.0
and broken in 5.0.1 ☹️

@janankit20
Copy link

@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 !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants