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

[BUG][JAVA] Model generation of array with uniqueItems=true is not working #18102

Closed
5 of 6 tasks
MelleD opened this issue Mar 14, 2024 · 0 comments · Fixed by #18104
Closed
5 of 6 tasks

[BUG][JAVA] Model generation of array with uniqueItems=true is not working #18102

MelleD opened this issue Mar 14, 2024 · 0 comments · Fixed by #18104

Comments

@MelleD
Copy link
Contributor

MelleD commented Mar 14, 2024

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Currently no more sets are generated if uniqueItems=true is set.

openapi-generator version

7.4.0/latest

OpenAPI declaration file content or url

If you post the code inline, please wrap it with

        stringSet:
          type: array
          uniqueItems: true
          items:
            type: string
        stringDefaultSet:
          type: array
          uniqueItems: true
          default:
            - A
            - B
          items:
            type: string
        stringEmptyDefaultSet:
          type: array
          uniqueItems: true
          default: []
          items:
            type: string

Out put is

  @Valid
  private List<String> stringSet = new ArrayList<>();

  @Valid
  private List<String> stringDefaultSet = new ArrayList<>(Arrays.asList("A", "B"));

  @Valid
  private List<String> stringEmptyDefaultSet = new ArrayList<>();
Generation Details

Spring Boot Cloud

Steps to reproduce
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.

1 participant