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][csharp] oneOf with arrays is generating duplicated 'GetList' #20739

Open
6 tasks done
GregoryMerlet opened this issue Feb 26, 2025 · 0 comments
Open
6 tasks done

Comments

@GregoryMerlet
Copy link
Contributor

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

When generating a model with a oneOf of arrays, the generated model contains two GetList which result in the following error when building:

error CS0111: Type 'OneOfArrayRequest' already defines a member called 'GetList' with the same parameter types
openapi-generator version

7.12.0 (latest master)

OpenAPI declaration file content or url
openapi: 3.0.1
info:
  title: Oneof array test
  version: 1.0.0
servers:
- url: /
paths:
  /one-of-array:
    post:
      description: Oneof array test
      operationId: oneOfArray
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - items:
                  type: string
                type: array
              - items:
                  $ref: '#/components/schemas/TestObject'
                type: array
      responses:
        "204":
          description: Successful operation
components:
  schemas:
    TestObject:
      properties:
        name:
          type: string
      type: object
Generation Details
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i ./oneOfArray.yaml -g csharp -o test
Steps to reproduce

Generate using the command above and try to build the generated code

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