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] [kotlin] [kotlin-spring] using uniqueItems when returning array in endpoint response generate wrong return type #20305

Open
5 of 6 tasks
martinosss opened this issue Dec 12, 2024 · 0 comments

Comments

@martinosss
Copy link

martinosss commented Dec 12, 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)
openapi-generator version

7.8.0

OpenAPI declaration file content or url
paths:
  /test:
    get:
      operationId: getTest
      tags:
        - test
      responses:
        200:
          content:
            application/json:
              schema:
                type: array
                uniqueItems: true
                items:
                  type: string
Generated code
fun getTest(): ResponseEntity<set<kotlin.collections.Set<kotlin.String>>> {

expected code:

fun getTest(): ResponseEntity<kotlin.collections.Set<kotlin.String>> {

however, the type is well generated when uniqueItems is used on a property that is inside an object

Steps to reproduce
  • Set up project
  • mvn clean compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant