Skip to content

Name conflict of components/schemas and operationId response objects #1357

Closed

Description

@Hrom-in-space

I attempted to generate a client using the official OpenAI specifications found at GitHub - openai/openai-openapi, but encountered a naming conflict.

For example:

openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.0.0
paths:
  /assistants:
    get:
      operationId: listAssistants
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListAssistantsResponse"
components:
  schemas:
    ListAssistantsResponse:
      type: string

This specification generates two types:

// this for schemas
type ListAssistantsResponse = string

// and this for response object
type ListAssistantsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ListAssistantsResponse
}

I'm considering making a merge request to fix this, but I'm unsure of the best approach. Here are some options:

  1. Rename the response object to operationID+OperationResponse or something similar.
  2. Append a suffix like Model to all schemas.
  3. Identify all conflicts at the end of generation and rename one of them.

Activity

  1. mromaszewicz commented on Mar 2, 2026

    @mromaszewicz
    Member

    This was addressed in #2213, please enable name conflict resolution via the output options and file a new issue if it doesn't work for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions