Skip to content

Ignoring underscores in operationId results in duplicate functions #1747

Closed
@evanhaldane

Description

@evanhaldane

Description

If your openapi spec has entries with operationIds like:

operationId: account___note_retrieve
...
operationId: account_note_retrieve

(which are auto-generated by drf-spectacular based on the paths)

then then both get mapped to accountNoteRetrieve (presumably because all underscores are ignored?)

This is using client-axios.

Reproducible example or configuration

npx @hey-api/openapi-ts -i 'schema.yml' -o src/schemas/mySchema -c @hey-api/client-axios

OpenAPI specification (optional)

/api/account/{blah}/{foo}-{bar}/note:
    get:
      operationId: account___note_retrieve
      parameters:
      - in: path
        name: blah
        schema:
          type: string
        required: true
      - in: path
        name: foo
        schema:
          type: string
        required: true
      - in: path
        name: bar
        schema:
          type: string
        required: true
/api/account/{blah}/note:
    get:
      operationId: account_note_retrieve
      parameters:
      - in: path
        name: blah
        schema:
          type: string
        required: true

System information (optional)

No response

Metadata

Metadata

Assignees

Labels

bug 🔥Something isn't workingprioritized 🚚This issue has been prioritized and will be worked on soon

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions