Skip to content

Duplication of operationId isn't validated #1248

Description

@ilya-hontarau

When specify duplicated operationId, codegen generates invalid golang code.
Expected behavior: return error during code generation.
Version: v1.14

Example:

openapi: "3.0.0"
info:
  title: operationId bug
  version: 1.0.0
paths:
  /things:
    get:
      operationId: listThings # duplicate
      responses:
        200:
          description: a list of things
          content:
            application/json:
              schema:
                type: string
  /bug:
    get:
      operationId: listThings # duplicate
      responses:
        200:
          description: a list of things
          content:
            application/json:
              schema:
                type: string

Code result:

// ServerInterface represents all server handlers.
type ServerInterface interface {

	// (GET /bug)
	ListThings(w http.ResponseWriter, r *http.Request)

	// (GET /things)
	ListThings(w http.ResponseWriter, r *http.Request)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions