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

Using oneOf to specify enum values for a property in schema doesn't generate the enums #15701

Open
amynguyen780 opened this issue May 31, 2023 · 6 comments

Comments

@amynguyen780
Copy link

Description

I want to be able to specify a description for each enum value for an enum property that is used in a schema for an object, and I had seen here that it was possible to do via oneOf for the enum property. However, following that, I wasn't able to get any enums generated.

openapi-generator version

6.5.0

OpenAPI declaration file content or url
  schemas:
    TargetBase:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        test_enum:
          type: string
          oneOf:
            - enum: [TEST1]
              description: testing 1
            - enum: [TEST2]
              description: testing 2
            - enum: [TEST3]
              description: testing 3
      description: The base entity that target objects extend from.
Command line used for generation

mvn generate-sources

Steps to reproduce

After specifying enum as in the above example, run mvn generate-sources in order to generate the OAS Java code. If you view the generated file for the enum object, you will see no enums defined.

Related issues/PRs

OAI/OpenAPI-Specification#348 (comment)

Suggest a fix/enhancement
@wing328
Copy link
Member

wing328 commented Jun 1, 2023

can you please try the latest master?

I think we just merged a PR recently fixing this issue.

@amynguyen780
Copy link
Author

I bumped to v6.6.0 locally and tried again but it still doesn't generate the enums

@amynguyen780
Copy link
Author

hi @wing328 , just checking with you to see if you had any ideas?

@tfrancois
Copy link

+1 Has this been fixed yet?

@Panossa
Copy link

Panossa commented Mar 13, 2024

2024: still not fixed, it seems

@SpotifyPhilipD
Copy link

@wing328 Can you please take another look at this?

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

No branches or pull requests

5 participants