I am developing a small web application with .NET Core backend and React (TS support) frontend.
For API definition/documentation I am using OpenAPI and have problems with code generation for the client. Bellow is a snippet of the yaml definitions (from swagger.json) that I use to generate client interfaces with Swagger Editor
crmObiskiPartnerjevResponse:
type: object
properties:
id:
type: integer
format: int32
PoslovniPartner:
type: integer
format: int32
nullable: true
DatumObiska:
type: string
format: date-time
nullable: true
NamenObiskaId:
type: integer
format: int32
nullable: true
Uporabnik:
type: integer
format: int32
nullable: true
Opomba:
type: string
nullable: true
NamenObiskaNaziv:
type: string
nullable: true
UporabnikNaziv:
type: string
nullable: true
PoslovniPartnerNaziv:
type: string
nullable: true
nullable: true
The problem is that when generating client code for typescript, Swagger editor messes up naming of properties. In this example it converts first letter to small cap (PoslovniPartner -> poslovniPartner). Any ideas would how to solve this would be much appreciated.
/**
* ECE_crmWebAPI
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
export interface CrmObiskiPartnerjevResponse {
id?: number;
poslovniPartner?: number;
datumObiska?: Date;
namenObiskaId?: number;
uporabnik?: number;
opomba?: string;
namenObiskaNaziv?: string;
uporabnikNaziv?: string;
poslovniPartnerNaziv?: string;
}