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

Duplicate "Client" struct generated if there is a component with the name "Client" in the openapi spec #785

Open
jedrivisser opened this issue Oct 13, 2022 · 0 comments

Comments

@jedrivisser
Copy link
Contributor

Tested this on latest and v1.11.0

Example of a minimal api that breaks code generation:

openapi: "3.0.0"
info:
  version: 1.0.0
  title: Client API
paths:
  /client:
    get:
      operationId: getClient
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Client"
components:
  schemas:
    Client:
      type: object
      required:
        - name
      properties:
        name:
          type: string

config to generate code:

package: api
output: api/api.gen.go
generate:
  models: true
  client: true

image
image

jedrivisser added a commit to diebietse/oapi-codegen that referenced this issue Oct 14, 2022
jedrivisser added a commit to diebietse/oapi-codegen that referenced this issue Oct 14, 2022
deepmap-marcinr pushed a commit that referenced this issue Oct 27, 2022
* Add client-type-prefix output option (#785)

* Override whole client type instead of prefixing it
adrianpk pushed a commit to foorester/oapi-codegen that referenced this issue Jan 16, 2024
* Add client-type-prefix output option (deepmap#785)

* Override whole client type instead of prefixing it
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