Skip to content

[typescript-fetch-client] can not get the property value from the response msg #3818

Open
@fish2016

Description

@fish2016
Description

Just like the following YAML and typescript-fetch-client generated code, the property name in YALM is of Snake case,
but the property name in generated typescript code is of camel case;
the name in YALM isn't same with the name in generated code,
so the value in message can not be resolved with the property name in the generated code.
after change the name in the generated code to snake case format, the value in message can be gotten correctly.

Is there any workaround to this issue?

This is the declaration of the response message in YAML
`CardBatchGetResp:

type: object

properties:

  errcode:

    type: integer

  errmsg:

    type: string

  card_id_list:

    type: string

  total_num:

    type: integer`

`

This is the typescript-fetch-client generated code from the declaration in YAML

`

export interface CardBatchGetResp {

"errcode"?: number;

"errmsg"?: string;

"cardIdList"?: string;

"totalNum"?: number;

}`

Swagger-codegen version

I don't konw which version am I using,
I use "http://editor.swagger.io/#/" to generate code, I know that Swagger Editor version is 2.10.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions