-
-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I have generated a React/TS client with openapi-generator.
The API is served by Django and Django REST Framework.
Django==4.2.6
drf-spectacular==0.28.0
djangorestframework==3.16.1
and
"@openapitools/openapi-generator-cli": "2.31.0",
I have noticed a bug in the api code generation:
The request definitions add a list of Omitted fields (which are the ones noted as read_only on the Django REST framework side).
However those fields are incorrectly written in snake-case in the Omit section.
Although they are correctly written in camel-case in the model definition.
Hence, the fields are not omitted, and the client complain that it doesn't find them when one try to use that request.
For instance, herebelow, the SingleCar field of the Mission model, is omitted as single_car (not SingleCar):
export interface CatalogMissionsCreateRequest {
mission: Omit<Mission, 'id'|'single_car'>;
format?: CatalogMissionsCreateFormatEnum;
}
export interface Mission {
/**
*
* @type {string}
* @memberof Mission
*/
readonly id: string;
/**
*
* @type {string}
* @memberof Mission
*/
name: string;
/**
*
* @type {Car}
* @memberof Mission
*/
readonly singleCar: Car;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working