[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)