Skip to content

Commit

Permalink
[TypeScriptAngular2Client] Changed enums single quotes for values to …
Browse files Browse the repository at this point in the history
…double. Updated test: enumArrayMdoelTest swagger-api#1334
  • Loading branch information
iain17 committed May 14, 2017
1 parent 99a73d3 commit 80ffbac
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public String toEnumValue(String value, String datatype) {
if ("number".equals(datatype)) {
return value;
} else {
return "\'" + escapeText(value) + "\'";
return "\"" + escapeText(value) + "\"";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ public void enumArrayMdoelTest() {

HashMap<String, String> fish= new HashMap<String, String>();
fish.put("name", "Fish");
fish.put("value", "'fish'");
fish.put("value", "\"fish\"");
HashMap<String, String> crab= new HashMap<String, String>();
crab.put("name", "Crab");
crab.put("value", "'crab'");
crab.put("value", "\"crab\"");
Assert.assertEquals(prope.allowableValues.get("enumVars"), Arrays.asList(fish, crab));

// assert inner items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export class Order {
}
export namespace OrderEnums {
export enum StatusEnum {
Placed = <any> 'placed',
Approved = <any> 'approved',
Delivered = <any> 'delivered'
Placed = <any> "placed",
Approved = <any> "approved",
Delivered = <any> "delivered"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export class Pet {
}
export namespace PetEnums {
export enum StatusEnum {
Available = <any> 'available',
Pending = <any> 'pending',
Sold = <any> 'sold'
Available = <any> "available",
Pending = <any> "pending",
Sold = <any> "sold"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export class Order {
}
export namespace OrderEnums {
export enum StatusEnum {
Placed = <any> 'placed',
Approved = <any> 'approved',
Delivered = <any> 'delivered'
Placed = <any> "placed",
Approved = <any> "approved",
Delivered = <any> "delivered"
}
}
6 changes: 3 additions & 3 deletions samples/client/petstore/typescript-angular2/npm/model/Pet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export class Pet {
}
export namespace PetEnums {
export enum StatusEnum {
Available = <any> 'available',
Pending = <any> 'pending',
Sold = <any> 'sold'
Available = <any> "available",
Pending = <any> "pending",
Sold = <any> "sold"
}
}

0 comments on commit 80ffbac

Please sign in to comment.