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

[Question][Java] Operation parameter with oneOf schema, but generating server #20494

Open
mirchello opened this issue Jan 17, 2025 · 0 comments

Comments

@mirchello
Copy link

mirchello commented Jan 17, 2025

I have rest specification with oneOf in parameters like #19442

/users:
    get:
      operationId: getUsers
      summary: Get users by array of numbers OR array of strings
      description: "May pass string or integer array."
      parameters:
        - in: query
          name: identifiers
          description: "String or integer array"
          required: true
          style: form
          explode: true
          schema:
            oneOf:
              - type: string
              - type: integer
        - in: query
          name: someParam
          description: "Just parameter"
          required: false
          schema:
            type: string

It's all ok for client generator now.
But i'm trying to generate spring serverver and in model have only one model for this parameter:

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.10.0")
public interface GetUsersIdentifiersParameter {
}

May be i'm doing something wrong and need more parameters?

java -jar openapi-generator-cli-7.10.0.jar generate -i rest.yaml -g spring

If parameters are ok and it's boug or not realized feature - can it be realized (may be some suggestions for contribution) or it has no reason?

@mirchello mirchello changed the title [Question] Operation parameter with oneOf schema, but generating server [Question][Java] Operation parameter with oneOf schema, but generating server Jan 17, 2025
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

1 participant