Skip to content

[BUG] Omitted fields are incorrectly set in snake-case #23380

@mmelcot

Description

@mmelcot

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 generation:
The request definitions, adds a list of Omitted fields (which are the ones noted as read_only on the Django REST framework side).
However those fields are incorrectly in snake-case,

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;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions