OpenAPITools / OpenAPITools/openapi-generator

[BUG] [typescript-axios] a property 'delete' is changed into '_delete' in output

Open
#7,474 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: TypeScript Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I have:

   AccessRights_SingleRightsObject:
      description: 
      type: object
      additionalProperties: false
      properties:
        create:
          type: boolean
          default: false
          example: true
        read:
          type: boolean
          default: false
          example: true
        update:
          type: boolean
          default: false
          example: true
        delete:
          type: boolean
          default: false
          example: true

The output is:

export interface AccessRightsSingleRightsObject {
    /**
     * @type {boolean}
     * @memberof AccessRightsSingleRightsObject
     */
    create?: boolean;
    /**
     * @type {boolean}
     * @memberof AccessRightsSingleRightsObject
     */
    read?: boolean;
    /**
     * @type {boolean}
     * @memberof AccessRightsSingleRightsObject
     */
    update?: boolean;
    /**
     * @type {boolean}
     * @memberof AccessRightsSingleRightsObject
     */
    _delete?: boolean;
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the typescript-axios generator and compare its property-name handling for the provided OpenAPI schema with the generated interface. Done means the schema's delete property remains named delete in the generated TypeScript output rather than becoming _delete.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.