diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Angular/model.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Angular/model.mustache index c533c6739a..b7d9296215 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Angular/model.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Angular/model.mustache @@ -18,7 +18,7 @@ namespace {{package}} { * {{{description}}} */ {{/description}} - {{name}}{{^required}}?{{/required}}: {{#isEnum}}{{classname}}.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; + "{{name}}"{{^required}}?{{/required}}: {{#isEnum}}{{classname}}.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; {{/vars}} } diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache index a80aa388d2..a4f2bf6202 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-node/api.mustache @@ -22,7 +22,7 @@ export class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{ * {{{description}}} */ {{/description}} - {{name}}: {{#isEnum}}{{classname}}.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; + "{{name}}": {{#isEnum}}{{classname}}.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; {{/vars}} } diff --git a/samples/client/petstore/typescript-angular/API/Client/Category.ts b/samples/client/petstore/typescript-angular/API/Client/Category.ts index a802fe4ebd..5e8c3bee67 100644 --- a/samples/client/petstore/typescript-angular/API/Client/Category.ts +++ b/samples/client/petstore/typescript-angular/API/Client/Category.ts @@ -5,9 +5,9 @@ namespace API.Client { export interface Category { - id?: number; + "id"?: number; - name?: string; + "name"?: string; } } diff --git a/samples/client/petstore/typescript-angular/API/Client/Order.ts b/samples/client/petstore/typescript-angular/API/Client/Order.ts index c01c648281..c86c372063 100644 --- a/samples/client/petstore/typescript-angular/API/Client/Order.ts +++ b/samples/client/petstore/typescript-angular/API/Client/Order.ts @@ -5,20 +5,20 @@ namespace API.Client { export interface Order { - id?: number; + "id"?: number; - petId?: number; + "petId"?: number; - quantity?: number; + "quantity"?: number; - shipDate?: Date; + "shipDate"?: Date; /** * Order Status */ - status?: Order.StatusEnum; + "status"?: Order.StatusEnum; - complete?: boolean; + "complete"?: boolean; } export namespace Order { diff --git a/samples/client/petstore/typescript-angular/API/Client/Pet.ts b/samples/client/petstore/typescript-angular/API/Client/Pet.ts index d0702f8d0e..bc3bcd11f2 100644 --- a/samples/client/petstore/typescript-angular/API/Client/Pet.ts +++ b/samples/client/petstore/typescript-angular/API/Client/Pet.ts @@ -5,20 +5,20 @@ namespace API.Client { export interface Pet { - id?: number; + "id"?: number; - category?: Category; + "category"?: Category; - name: string; + "name": string; - photoUrls: Array; + "photoUrls": Array; - tags?: Array; + "tags"?: Array; /** * pet status in the store */ - status?: Pet.StatusEnum; + "status"?: Pet.StatusEnum; } export namespace Pet { diff --git a/samples/client/petstore/typescript-angular/API/Client/Tag.ts b/samples/client/petstore/typescript-angular/API/Client/Tag.ts index 1c0284cce4..9c24419ec3 100644 --- a/samples/client/petstore/typescript-angular/API/Client/Tag.ts +++ b/samples/client/petstore/typescript-angular/API/Client/Tag.ts @@ -5,9 +5,9 @@ namespace API.Client { export interface Tag { - id?: number; + "id"?: number; - name?: string; + "name"?: string; } } diff --git a/samples/client/petstore/typescript-angular/API/Client/User.ts b/samples/client/petstore/typescript-angular/API/Client/User.ts index 7c2b0b78b0..4744abb6a7 100644 --- a/samples/client/petstore/typescript-angular/API/Client/User.ts +++ b/samples/client/petstore/typescript-angular/API/Client/User.ts @@ -5,24 +5,24 @@ namespace API.Client { export interface User { - id?: number; + "id"?: number; - username?: string; + "username"?: string; - firstName?: string; + "firstName"?: string; - lastName?: string; + "lastName"?: string; - email?: string; + "email"?: string; - password?: string; + "password"?: string; - phone?: string; + "phone"?: string; /** * User Status */ - userStatus?: number; + "userStatus"?: number; } } diff --git a/samples/client/petstore/typescript-angular/README.md b/samples/client/petstore/typescript-angular/README.md index 3a4e49be9e..0cc8064bed 100644 --- a/samples/client/petstore/typescript-angular/README.md +++ b/samples/client/petstore/typescript-angular/README.md @@ -16,4 +16,4 @@ npm run clean ## Author -mads@maetzke-tandrup.dk \ No newline at end of file +mads@maetzke-tandrup.dk, Swagger-Codegen community diff --git a/samples/client/petstore/typescript-node/README.md b/samples/client/petstore/typescript-node/README.md index 82225d3260..02d993a5de 100644 --- a/samples/client/petstore/typescript-node/README.md +++ b/samples/client/petstore/typescript-node/README.md @@ -19,4 +19,4 @@ npm run clean ## Author -mads@maetzke-tandrup.dk \ No newline at end of file +mads@maetzke-tandrup.dk, Swagger-Codegen community diff --git a/samples/client/petstore/typescript-node/api.ts b/samples/client/petstore/typescript-node/api.ts index 2f2716caba..c6a0b323eb 100644 --- a/samples/client/petstore/typescript-node/api.ts +++ b/samples/client/petstore/typescript-node/api.ts @@ -9,34 +9,34 @@ import http = require('http'); /* tslint:disable:no-unused-variable */ export class User { - id: number; - username: string; - firstName: string; - lastName: string; - email: string; - password: string; - phone: string; + "id": number; + "username": string; + "firstName": string; + "lastName": string; + "email": string; + "password": string; + "phone": string; /** * User Status */ - userStatus: number; + "userStatus": number; } export class Category { - id: number; - name: string; + "id": number; + "name": string; } export class Pet { - id: number; - category: Category; - name: string; - photoUrls: Array; - tags: Array; + "id": number; + "category": Category; + "name": string; + "photoUrls": Array; + "tags": Array; /** * pet status in the store */ - status: Pet.StatusEnum; + "status": Pet.StatusEnum; } export namespace Pet { @@ -47,20 +47,20 @@ export namespace Pet { } } export class Tag { - id: number; - name: string; + "id": number; + "name": string; } export class Order { - id: number; - petId: number; - quantity: number; - shipDate: Date; + "id": number; + "petId": number; + "quantity": number; + "shipDate": Date; /** * Order Status */ - status: Order.StatusEnum; - complete: boolean; + "status": Order.StatusEnum; + "complete": boolean; } export namespace Order {