swagger-api/swagger-codegen

[Angular2] attributes are snake_cased

开放

#4,774 创建于 2017年2月11日

 (11 条评论) (9 个反应) (0 位负责人)HTML (5,474 个派生)batch import
Client: TypeScriptIssue: Bughelp wanted

仓库指标

星标
 (12,701 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Description

In my generated files, the attribute in the model interfaces are all camelCased, but the fetched data is snake_cased and not changed.

export interface User {
    /**
     * The ID of the user.
     */
    userId: number;
[...]

returned object: { user_id: 12, ... }

Swagger-codegen version

the version used by http://editor.swagger.io/

Notes

However, when sending some formParams (POST) to the server, then the generated code converts the attributes:

if (challengeId !== undefined) {
    formParams.set('challenge_id', <any>challengeId);
}

贡献者指南