Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #2120
Closed
Open
Issue created Feb 11, 2019 by Administrator@rootContributor

[BUG] [typescript-angular] Incorrect OperationId Generated (starting with number)

Created by: karismann

Description

If you have an input declaration with an operationId starting with a number, the angular client generator doesn't transform this operationId and the code generated is incorrect with the TS1351 error :

"An identifier or keyword cannot immediately follow a numeric literal."

openapi-generator version

4.0.0-SNAPSHOT

OpenAPI declaration file content or url
  /another-fake/dummy:
    patch:
      tags:
        - $another-fake?
      summary: To test special tags
      description: To test special tags and operation ID starting with number
      operationId: '123_test_@#$%_special_tags'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
      requestBody:
        $ref: '#/components/requestBodies/Client'

generate

    public 123testSpecialTags(client: Client, observe?: 'body', reportProgress?: boolean): Observable<Client>;
    public 123testSpecialTags(client: Client, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Client>>;
    public 123testSpecialTags(client: Client, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Client>>;
...

instead of

    public _123testSpecialTags(client: Client, observe?: 'body', reportProgress?: boolean): Observable<Client>;
    public _123testSpecialTags(client: Client, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Client>>;
    public _123testSpecialTags(client: Client, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Client>>;
...
Suggest a fix

I will send a PR (i fixed the code locally)

Assignee
Assign to
Time tracking