diff --git a/Fonlow.OpenApiClientGen/Fonlow.OpenApiClientGen.csproj b/Fonlow.OpenApiClientGen/Fonlow.OpenApiClientGen.csproj
index 411195eb..4b71c07a 100644
--- a/Fonlow.OpenApiClientGen/Fonlow.OpenApiClientGen.csproj
+++ b/Fonlow.OpenApiClientGen/Fonlow.OpenApiClientGen.csproj
@@ -11,7 +11,7 @@
MIT
en
Copyright © Zijian Huang 2021-$([System.DateTime]::Now.Year)
- 3.2.3
+ 3.2.4
Swagger, Open API Specification, C#, .NET Core, Web API, TypeScript, Angular, YAML
.NET 9
latest-all
diff --git a/OpenApiClientGenCore.NG2FormGroup/CodeObjectHelperForNg2FormGroup.cs b/OpenApiClientGenCore.NG2FormGroup/CodeObjectHelperForNg2FormGroup.cs
index 323e57fb..fd36622a 100644
--- a/OpenApiClientGenCore.NG2FormGroup/CodeObjectHelperForNg2FormGroup.cs
+++ b/OpenApiClientGenCore.NG2FormGroup/CodeObjectHelperForNg2FormGroup.cs
@@ -11,12 +11,12 @@ namespace Fonlow.TypeScriptCodeDom
public class CodeObjectHelperForNg2FormGroup : CodeObjectHelper
{
readonly CodeNamespaceCollection codeNamespaceCollection;
- readonly bool careForDateOnly;
+ readonly bool ngDateOnlyFormControlEnabled;
- public CodeObjectHelperForNg2FormGroup(CodeNamespaceCollection codeNamespaceCollection, bool careForDateOnly = false) : base(true)
+ public CodeObjectHelperForNg2FormGroup(CodeNamespaceCollection codeNamespaceCollection, bool ngDateOnlyFormControlEnabled = false) : base(true)
{
this.codeNamespaceCollection = codeNamespaceCollection;
- this.careForDateOnly = careForDateOnly;
+ this.ngDateOnlyFormControlEnabled = ngDateOnlyFormControlEnabled;
}
///
@@ -210,6 +210,7 @@ string GetCodeMemberFieldTextForAngularFormGroup(CodeMemberField codeMemberField
bool isFieldDateOnly = false;
var customAttributes = codeMemberField.CustomAttributes;
var fieldName = codeMemberField.Name.EndsWith('?') ? codeMemberField.Name.Substring(0, codeMemberField.Name.Length - 1) : codeMemberField.Name;
+ var tsTypeName = RefineAngularFormControlTypeName(codeMemberField);
FieldTypeInfo fieldTypeInfo = codeMemberField.Type.UserData[UserDataKeys.FieldTypeInfo] as FieldTypeInfo;
if (fieldTypeInfo.ClrType == typeof(DateOnly) || fieldTypeInfo.ClrType == typeof(DateOnly?))
{
@@ -259,11 +260,11 @@ string GetCodeMemberFieldTextForAngularFormGroup(CodeMemberField codeMemberField
Console.WriteLine();
var text = String.Join(", ", validatorList);
- var tsTypeName = RefineAngularFormControlTypeName(codeMemberField);
+
- if (isFieldDateOnly && careForDateOnly)
+ if (isFieldDateOnly && ngDateOnlyFormControlEnabled)
{
- return $"{fieldName}: CreateDateOnlyFormControl()";
+ return $"{fieldName}: CreateDateOnlyFormControl()"; // DateOnly field is generally with a date picker component, no validator expected? Until someone find a def with validation rules.
}
else
{
@@ -273,8 +274,14 @@ string GetCodeMemberFieldTextForAngularFormGroup(CodeMemberField codeMemberField
}
else
{
- var tsTypeName = RefineAngularFormControlTypeName(codeMemberField);
- return $"{fieldName}: new FormControl<{tsTypeName}>(undefined)";
+ if (isFieldDateOnly && ngDateOnlyFormControlEnabled)
+ {
+ return $"{fieldName}: CreateDateOnlyFormControl()";
+ }
+ else
+ {
+ return $"{fieldName}: new FormControl<{tsTypeName}>(undefined)";
+ }
}
}
diff --git a/OpenApiClientGenCore.NG2FormGroup/OpenApiClientGenCore.NG2FormGroup.csproj b/OpenApiClientGenCore.NG2FormGroup/OpenApiClientGenCore.NG2FormGroup.csproj
index 352a5295..717d5cc1 100644
--- a/OpenApiClientGenCore.NG2FormGroup/OpenApiClientGenCore.NG2FormGroup.csproj
+++ b/OpenApiClientGenCore.NG2FormGroup/OpenApiClientGenCore.NG2FormGroup.csproj
@@ -7,7 +7,7 @@
Copyright © Zijian Huang 2021-$([System.DateTime]::Now.Year)
Zijian Huang
Fonlow.OpenApiClientGen.NG2FormGroup
- 2.2
+ 2.2.1
latest-all
DateOnly FormControl with NgDateOnlyFormControlEnabled
diff --git a/Tests/SwagTsTests/AureliaResults/Pet.txt b/Tests/SwagTsTests/AureliaResults/Pet.ts
similarity index 96%
rename from Tests/SwagTsTests/AureliaResults/Pet.txt
rename to Tests/SwagTsTests/AureliaResults/Pet.ts
index f7102258..3faa57e3 100644
--- a/Tests/SwagTsTests/AureliaResults/Pet.txt
+++ b/Tests/SwagTsTests/AureliaResults/Pet.ts
@@ -1,402 +1,402 @@
-import {HttpClient} from 'aurelia-fetch-client';
-import {autoinject} from 'aurelia-framework';
-export namespace MyNS {
- export interface ApiResponse {
-
- /** Type: int, -2,147,483,648 to 2,147,483,647 */
- code?: number | null;
- type?: string | null;
- message?: string | null;
- }
-
-
- /** A representation of a cat */
- export interface Cat extends Pet {
-
- /**
- * The measured skill for hunting
- * Required
- */
- huntingSkill: CatHuntingSkill;
- }
-
- export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 }
-
- export interface Category {
-
- /** Category ID */
- id?: string | null;
-
- /**
- * Category name
- * Min length: 1
- */
- name?: string | null;
-
- /** Test Sub Category */
- sub?: CategorySub;
- }
-
- export interface CategorySub {
-
- /** Dumb Property */
- prop1?: string | null;
- }
-
-
- /** A representation of a dog */
- export interface Dog extends Pet {
-
- /**
- * The size of the pack the dog is from
- * Required
- * Minimum: 1
- */
- packSize: number;
- }
-
-
- /** A representation of a honey bee */
- export interface HoneyBee extends Pet {
-
- /**
- * Average amount of honey produced per day in ounces
- * Required
- * Type: double
- */
- honeyPerDay: number;
- }
-
- export interface Order {
-
- /** Order ID */
- id?: string | null;
-
- /** Pet ID */
- petId?: string | null;
-
- /** Minimum: 1 */
- quantity?: number | null;
-
- /** Estimated ship date */
- shipDate?: Date | null;
-
- /** Order Status */
- status?: OrderStatus | null;
-
- /** Indicates whenever order was completed or not */
- complete?: boolean | null;
-
- /** Unique Request Id */
- requestId?: string | null;
- }
-
- export enum OrderStatus { placed = 0, approved = 1, delivered = 2 }
-
- export interface Pet {
-
- /** Pet ID */
- id?: string | null;
-
- /** Categories this pet belongs to */
- category?: Category;
-
- /**
- * The name given to a pet
- * Required
- */
- name: string;
-
- /**
- * The list of URL to a cute photos featuring pet
- * Required
- * Maximum items: 20
- */
- photoUrls: Array;
- friend?: Pet;
-
- /**
- * Tags attached to the pet
- * Minimum items: 1
- */
- tags?: Array;
-
- /** Pet status in the store */
- status?: PetStatus | null;
-
- /** Type of a pet */
- petType?: string | null;
- }
-
- export interface Tag {
-
- /** Tag ID */
- id?: string | null;
-
- /**
- * Tag name
- * Min length: 1
- */
- name?: string | null;
- }
-
- export enum PetStatus { available = 0, pending = 1, sold = 2 }
-
- export interface User {
-
- /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
- id?: string | null;
- pet?: Pet;
-
- /**
- * User supplied username
- * Min length: 4
- */
- username?: string | null;
-
- /**
- * User first name
- * Min length: 1
- */
- firstName?: string | null;
-
- /**
- * User last name
- * Min length: 1
- */
- lastName?: string | null;
-
- /** User email address */
- email?: string | null;
-
- /**
- * User password, MUST contain a mix of upper and lower case letters, as well as digits
- * Min length: 8
- */
- password?: string | null;
-
- /** User phone number in international format */
- phone?: string | null;
-
- /**
- * User status
- * Type: int, -2,147,483,648 to 2,147,483,647
- */
- userStatus?: number | null;
- }
-
- @autoinject()
- export class PetClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Add a new pet to the store
- * Add new pet to the store inventory.
- * Post pet
- * @param {Pet} requestBody Pet object that needs to be added to the store
- * @return {void}
- */
- AddPet(requestBody: Pet): Promise {
- return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Update an existing pet
- * Put pet
- * @param {Pet} requestBody Pet object that needs to be added to the store
- * @return {void}
- */
- UpdatePet(requestBody: Pet): Promise {
- return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Find pet by ID
- * Returns a single pet
- * Get pet/{petId}
- * @param {string} petId ID of pet to return
- * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
- * @return {Pet} successful operation
- */
- GetPetById(petId: string): Promise {
- return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Deletes a pet
- * Delete pet/{petId}
- * @param {string} petId Pet id to delete
- * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
- * @return {void}
- */
- DeletePet(petId: string): Promise {
- return this.http.delete('pet/' + petId, {});
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * Get pet/findByStatus
- * @param {Array} status Status values that need to be considered for filter
- * Minimum items: 1 Maximum items: 3
- * @return {Array} successful operation
- */
- FindPetsByStatus(status: Array): Promise> {
- return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * Get pet/findByTags
- * @param {Array} tags Tags to filter by
- * @return {Array} successful operation
- */
- FindPetsByTags(tags: Array): Promise> {
- return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
- }
-
- @autoinject()
- export class StoreClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Returns pet inventories by status
- * Returns a map of status codes to quantities
- * Get store/inventory
- * @return {{[id: string]: number }} successful operation
- */
- GetInventory(): Promise<{[id: string]: number }> {
- return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Place an order for a pet
- * Post store/order
- * @param {Order} requestBody order placed for purchasing the pet
- * @return {Order} successful operation
- */
- PlaceOrder(requestBody: Order): Promise {
- return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Find purchase order by ID
- * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- * Get store/order/{orderId}
- * @param {string} orderId ID of pet that needs to be fetched
- * Minimum: 1 Maximum: 5
- * @return {Order} successful operation
- */
- GetOrderById(orderId: string): Promise {
- return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Delete purchase order by ID
- * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- * Delete store/order/{orderId}
- * @param {string} orderId ID of the order that needs to be deleted
- * Minimum: 1
- * @return {void}
- */
- DeleteOrder(orderId: string): Promise {
- return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {});
- }
- }
-
- @autoinject()
- export class UserClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Create user
- * This can only be done by the logged in user.
- * Post user
- * @param {User} requestBody Created user object
- * @return {void}
- */
- CreateUser(requestBody: User): Promise {
- return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Get user by user name
- * Get user/{username}
- * @param {string} username The name that needs to be fetched. Use user1 for testing.
- * @return {User} successful operation
- */
- GetUserByName(username: string): Promise {
- return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Updated user
- * This can only be done by the logged in user.
- * Put user/{username}
- * @param {string} username name that need to be deleted
- * @param {User} requestBody Updated user object
- * @return {void}
- */
- UpdateUser(username: string, requestBody: User): Promise {
- return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Delete user
- * This can only be done by the logged in user.
- * Delete user/{username}
- * @param {string} username The name that needs to be deleted
- * @return {void}
- */
- DeleteUser(username: string): Promise {
- return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {});
- }
-
- /**
- * Creates list of users with given input array
- * Post user/createWithArray
- * @param {Array} requestBody List of user object
- * @return {void}
- */
- CreateUsersWithArrayInput(requestBody: Array): Promise {
- return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Creates list of users with given input array
- * Post user/createWithList
- * @param {Array} requestBody List of user object
- * @return {void}
- */
- CreateUsersWithListInput(requestBody: Array): Promise {
- return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Logs user into the system
- * Get user/login
- * @param {string} username The user name for login
- * @param {string} password The password for login in clear text
- * @return {string} successful operation
- */
- LoginUser(username: string, password: string): Promise {
- return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;});
- }
-
- /**
- * Logs out current logged in user session
- * Get user/logout
- * @return {void}
- */
- LogoutUser(): Promise {
- return this.http.get('user/logout', {});
- }
- }
-
-}
-
+import {HttpClient} from 'aurelia-fetch-client';
+import {autoinject} from 'aurelia-framework';
+export namespace MyNS {
+ export interface ApiResponse {
+
+ /** Type: int, -2,147,483,648 to 2,147,483,647 */
+ code?: number | null;
+ type?: string | null;
+ message?: string | null;
+ }
+
+
+ /** A representation of a cat */
+ export interface Cat extends Pet {
+
+ /**
+ * The measured skill for hunting
+ * Required
+ */
+ huntingSkill: CatHuntingSkill;
+ }
+
+ export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 }
+
+ export interface Category {
+
+ /** Category ID */
+ id?: string | null;
+
+ /**
+ * Category name
+ * Min length: 1
+ */
+ name?: string | null;
+
+ /** Test Sub Category */
+ sub?: CategorySub;
+ }
+
+ export interface CategorySub {
+
+ /** Dumb Property */
+ prop1?: string | null;
+ }
+
+
+ /** A representation of a dog */
+ export interface Dog extends Pet {
+
+ /**
+ * The size of the pack the dog is from
+ * Required
+ * Minimum: 1
+ */
+ packSize: number;
+ }
+
+
+ /** A representation of a honey bee */
+ export interface HoneyBee extends Pet {
+
+ /**
+ * Average amount of honey produced per day in ounces
+ * Required
+ * Type: double
+ */
+ honeyPerDay: number;
+ }
+
+ export interface Order {
+
+ /** Order ID */
+ id?: string | null;
+
+ /** Pet ID */
+ petId?: string | null;
+
+ /** Minimum: 1 */
+ quantity?: number | null;
+
+ /** Estimated ship date */
+ shipDate?: Date | null;
+
+ /** Order Status */
+ status?: OrderStatus | null;
+
+ /** Indicates whenever order was completed or not */
+ complete?: boolean | null;
+
+ /** Unique Request Id */
+ requestId?: string | null;
+ }
+
+ export enum OrderStatus { placed = 0, approved = 1, delivered = 2 }
+
+ export interface Pet {
+
+ /** Pet ID */
+ id?: string | null;
+
+ /** Categories this pet belongs to */
+ category?: Category;
+
+ /**
+ * The name given to a pet
+ * Required
+ */
+ name: string;
+
+ /**
+ * The list of URL to a cute photos featuring pet
+ * Required
+ * Maximum items: 20
+ */
+ photoUrls: Array;
+ friend?: Pet;
+
+ /**
+ * Tags attached to the pet
+ * Minimum items: 1
+ */
+ tags?: Array;
+
+ /** Pet status in the store */
+ status?: PetStatus | null;
+
+ /** Type of a pet */
+ petType?: string | null;
+ }
+
+ export interface Tag {
+
+ /** Tag ID */
+ id?: string | null;
+
+ /**
+ * Tag name
+ * Min length: 1
+ */
+ name?: string | null;
+ }
+
+ export enum PetStatus { available = 0, pending = 1, sold = 2 }
+
+ export interface User {
+
+ /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
+ id?: string | null;
+ pet?: Pet;
+
+ /**
+ * User supplied username
+ * Min length: 4
+ */
+ username?: string | null;
+
+ /**
+ * User first name
+ * Min length: 1
+ */
+ firstName?: string | null;
+
+ /**
+ * User last name
+ * Min length: 1
+ */
+ lastName?: string | null;
+
+ /** User email address */
+ email?: string | null;
+
+ /**
+ * User password, MUST contain a mix of upper and lower case letters, as well as digits
+ * Min length: 8
+ */
+ password?: string | null;
+
+ /** User phone number in international format */
+ phone?: string | null;
+
+ /**
+ * User status
+ * Type: int, -2,147,483,648 to 2,147,483,647
+ */
+ userStatus?: number | null;
+ }
+
+ @autoinject()
+ export class PetClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Add a new pet to the store
+ * Add new pet to the store inventory.
+ * Post pet
+ * @param {Pet} requestBody Pet object that needs to be added to the store
+ * @return {void}
+ */
+ AddPet(requestBody: Pet): Promise {
+ return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Update an existing pet
+ * Put pet
+ * @param {Pet} requestBody Pet object that needs to be added to the store
+ * @return {void}
+ */
+ UpdatePet(requestBody: Pet): Promise {
+ return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ * Get pet/{petId}
+ * @param {string} petId ID of pet to return
+ * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
+ * @return {Pet} successful operation
+ */
+ GetPetById(petId: string): Promise {
+ return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Deletes a pet
+ * Delete pet/{petId}
+ * @param {string} petId Pet id to delete
+ * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
+ * @return {void}
+ */
+ DeletePet(petId: string): Promise {
+ return this.http.delete('pet/' + petId, {});
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * Get pet/findByStatus
+ * @param {Array} status Status values that need to be considered for filter
+ * Minimum items: 1 Maximum items: 3
+ * @return {Array} successful operation
+ */
+ FindPetsByStatus(status: Array): Promise> {
+ return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * Get pet/findByTags
+ * @param {Array} tags Tags to filter by
+ * @return {Array} successful operation
+ */
+ FindPetsByTags(tags: Array): Promise> {
+ return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+ }
+
+ @autoinject()
+ export class StoreClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ * Get store/inventory
+ * @return {{[id: string]: number }} successful operation
+ */
+ GetInventory(): Promise<{[id: string]: number }> {
+ return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Place an order for a pet
+ * Post store/order
+ * @param {Order} requestBody order placed for purchasing the pet
+ * @return {Order} successful operation
+ */
+ PlaceOrder(requestBody: Order): Promise {
+ return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Find purchase order by ID
+ * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ * Get store/order/{orderId}
+ * @param {string} orderId ID of pet that needs to be fetched
+ * Minimum: 1 Maximum: 5
+ * @return {Order} successful operation
+ */
+ GetOrderById(orderId: string): Promise {
+ return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ * Delete store/order/{orderId}
+ * @param {string} orderId ID of the order that needs to be deleted
+ * Minimum: 1
+ * @return {void}
+ */
+ DeleteOrder(orderId: string): Promise {
+ return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {});
+ }
+ }
+
+ @autoinject()
+ export class UserClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Create user
+ * This can only be done by the logged in user.
+ * Post user
+ * @param {User} requestBody Created user object
+ * @return {void}
+ */
+ CreateUser(requestBody: User): Promise {
+ return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Get user by user name
+ * Get user/{username}
+ * @param {string} username The name that needs to be fetched. Use user1 for testing.
+ * @return {User} successful operation
+ */
+ GetUserByName(username: string): Promise {
+ return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Updated user
+ * This can only be done by the logged in user.
+ * Put user/{username}
+ * @param {string} username name that need to be deleted
+ * @param {User} requestBody Updated user object
+ * @return {void}
+ */
+ UpdateUser(username: string, requestBody: User): Promise {
+ return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Delete user
+ * This can only be done by the logged in user.
+ * Delete user/{username}
+ * @param {string} username The name that needs to be deleted
+ * @return {void}
+ */
+ DeleteUser(username: string): Promise {
+ return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {});
+ }
+
+ /**
+ * Creates list of users with given input array
+ * Post user/createWithArray
+ * @param {Array} requestBody List of user object
+ * @return {void}
+ */
+ CreateUsersWithArrayInput(requestBody: Array): Promise {
+ return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Creates list of users with given input array
+ * Post user/createWithList
+ * @param {Array} requestBody List of user object
+ * @return {void}
+ */
+ CreateUsersWithListInput(requestBody: Array): Promise {
+ return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Logs user into the system
+ * Get user/login
+ * @param {string} username The user name for login
+ * @param {string} password The password for login in clear text
+ * @return {string} successful operation
+ */
+ LoginUser(username: string, password: string): Promise {
+ return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;});
+ }
+
+ /**
+ * Logs out current logged in user session
+ * Get user/logout
+ * @return {void}
+ */
+ LogoutUser(): Promise {
+ return this.http.get('user/logout', {});
+ }
+ }
+
+}
+
diff --git a/Tests/SwagTsTests/AureliaResults/PetDelete.txt b/Tests/SwagTsTests/AureliaResults/PetDelete.ts
similarity index 95%
rename from Tests/SwagTsTests/AureliaResults/PetDelete.txt
rename to Tests/SwagTsTests/AureliaResults/PetDelete.ts
index ae35c5c4..f3ffcd66 100644
--- a/Tests/SwagTsTests/AureliaResults/PetDelete.txt
+++ b/Tests/SwagTsTests/AureliaResults/PetDelete.ts
@@ -1,22 +1,22 @@
-import {HttpClient} from 'aurelia-fetch-client';
-import {autoinject} from 'aurelia-framework';
-export namespace MyNS {
- @autoinject()
- export class PetClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Deletes a pet
- * Delete pet/{petId}
- * @param {string} petId Pet id to delete
- * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
- * @return {void}
- */
- DeletePet(petId: string): Promise {
- return this.http.delete('pet/' + petId, {});
- }
- }
-
-}
-
+import {HttpClient} from 'aurelia-fetch-client';
+import {autoinject} from 'aurelia-framework';
+export namespace MyNS {
+ @autoinject()
+ export class PetClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Deletes a pet
+ * Delete pet/{petId}
+ * @param {string} petId Pet id to delete
+ * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
+ * @return {void}
+ */
+ DeletePet(petId: string): Promise {
+ return this.http.delete('pet/' + petId, {});
+ }
+ }
+
+}
+
diff --git a/Tests/SwagTsTests/AureliaResults/PetFindByStatus.txt b/Tests/SwagTsTests/AureliaResults/PetFindByStatus.ts
similarity index 96%
rename from Tests/SwagTsTests/AureliaResults/PetFindByStatus.txt
rename to Tests/SwagTsTests/AureliaResults/PetFindByStatus.ts
index 51342496..cf0e16c8 100644
--- a/Tests/SwagTsTests/AureliaResults/PetFindByStatus.txt
+++ b/Tests/SwagTsTests/AureliaResults/PetFindByStatus.ts
@@ -1,124 +1,124 @@
-import {HttpClient} from 'aurelia-fetch-client';
-import {autoinject} from 'aurelia-framework';
-export namespace MyNS {
-
- /** A representation of a cat */
- export interface Cat extends Pet {
-
- /** The measured skill for hunting */
- huntingSkill: CatHuntingSkill;
- }
-
- export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 }
-
- export interface Category {
-
- /** Category ID */
- id?: string | null;
-
- /** Category name */
- name?: string | null;
-
- /** Test Sub Category */
- sub?: CategorySub;
- }
-
- export interface CategorySub {
-
- /** Dumb Property */
- prop1?: string | null;
- }
-
-
- /** A representation of a dog */
- export interface Dog extends Pet {
-
- /** The size of the pack the dog is from */
- packSize: number;
- }
-
-
- /** A representation of a honey bee */
- export interface HoneyBee extends Pet {
-
- /** Average amount of honey produced per day in ounces */
- honeyPerDay: number;
- }
-
- export interface Pet {
-
- /** Pet ID */
- id?: string | null;
-
- /** Categories this pet belongs to */
- category?: Category;
-
- /** The name given to a pet */
- name: string;
-
- /** The list of URL to a cute photos featuring pet */
- photoUrls: Array;
- friend?: Pet;
-
- /** Tags attached to the pet */
- tags?: Array;
-
- /** Pet status in the store */
- status?: PetStatus | null;
-
- /** Type of a pet */
- petType?: string | null;
- }
-
- export interface Tag {
-
- /** Tag ID */
- id?: string | null;
-
- /** Tag name */
- name?: string | null;
- }
-
- export enum PetStatus { available = 0, pending = 1, sold = 2 }
-
- @autoinject()
- export class Misc {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * Get pet/findByStatus
- * @param {Array} status Status values that need to be considered for filter
- * @return {Array} successful operation
- */
- FindPetsByStatus(status: Array): Promise> {
- return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * Get pet/findByStatus2
- * @param {PetStatus} status Status values that need to be considered for filter
- * @return {Array} successful operation
- */
- FindPetsByStatus2(status: PetStatus): Promise> {
- return this.http.get('pet/findByStatus2?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * Get pet/findByStatus3
- * @param {PetStatus} status Status values that need to be considered for filter
- * @return {Array} successful operation
- */
- FindPetsByStatus3(status: PetStatus): Promise> {
- return this.http.get('pet/findByStatus3?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
- }
-
-}
-
+import {HttpClient} from 'aurelia-fetch-client';
+import {autoinject} from 'aurelia-framework';
+export namespace MyNS {
+
+ /** A representation of a cat */
+ export interface Cat extends Pet {
+
+ /** The measured skill for hunting */
+ huntingSkill: CatHuntingSkill;
+ }
+
+ export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 }
+
+ export interface Category {
+
+ /** Category ID */
+ id?: string | null;
+
+ /** Category name */
+ name?: string | null;
+
+ /** Test Sub Category */
+ sub?: CategorySub;
+ }
+
+ export interface CategorySub {
+
+ /** Dumb Property */
+ prop1?: string | null;
+ }
+
+
+ /** A representation of a dog */
+ export interface Dog extends Pet {
+
+ /** The size of the pack the dog is from */
+ packSize: number;
+ }
+
+
+ /** A representation of a honey bee */
+ export interface HoneyBee extends Pet {
+
+ /** Average amount of honey produced per day in ounces */
+ honeyPerDay: number;
+ }
+
+ export interface Pet {
+
+ /** Pet ID */
+ id?: string | null;
+
+ /** Categories this pet belongs to */
+ category?: Category;
+
+ /** The name given to a pet */
+ name: string;
+
+ /** The list of URL to a cute photos featuring pet */
+ photoUrls: Array;
+ friend?: Pet;
+
+ /** Tags attached to the pet */
+ tags?: Array;
+
+ /** Pet status in the store */
+ status?: PetStatus | null;
+
+ /** Type of a pet */
+ petType?: string | null;
+ }
+
+ export interface Tag {
+
+ /** Tag ID */
+ id?: string | null;
+
+ /** Tag name */
+ name?: string | null;
+ }
+
+ export enum PetStatus { available = 0, pending = 1, sold = 2 }
+
+ @autoinject()
+ export class Misc {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * Get pet/findByStatus
+ * @param {Array} status Status values that need to be considered for filter
+ * @return {Array} successful operation
+ */
+ FindPetsByStatus(status: Array): Promise> {
+ return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * Get pet/findByStatus2
+ * @param {PetStatus} status Status values that need to be considered for filter
+ * @return {Array} successful operation
+ */
+ FindPetsByStatus2(status: PetStatus): Promise> {
+ return this.http.get('pet/findByStatus2?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * Get pet/findByStatus3
+ * @param {PetStatus} status Status values that need to be considered for filter
+ * @return {Array} successful operation
+ */
+ FindPetsByStatus3(status: PetStatus): Promise> {
+ return this.http.get('pet/findByStatus3?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+ }
+
+}
+
diff --git a/Tests/SwagTsTests/AureliaResults/PetGodClass.txt b/Tests/SwagTsTests/AureliaResults/PetGodClass.ts
similarity index 96%
rename from Tests/SwagTsTests/AureliaResults/PetGodClass.txt
rename to Tests/SwagTsTests/AureliaResults/PetGodClass.ts
index 46a1da1a..2796a6f7 100644
--- a/Tests/SwagTsTests/AureliaResults/PetGodClass.txt
+++ b/Tests/SwagTsTests/AureliaResults/PetGodClass.ts
@@ -1,337 +1,337 @@
-import {HttpClient} from 'aurelia-fetch-client';
-import {autoinject} from 'aurelia-framework';
-export namespace MyNS {
- export interface ApiResponse {
- code?: number | null;
- type?: string | null;
- message?: string | null;
- }
-
-
- /** A representation of a cat */
- export interface Cat extends Pet {
-
- /** The measured skill for hunting */
- huntingSkill: CatHuntingSkill;
- }
-
- export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 }
-
- export interface Category {
-
- /** Category ID */
- id?: string | null;
-
- /** Category name */
- name?: string | null;
-
- /** Test Sub Category */
- sub?: CategorySub;
- }
-
- export interface CategorySub {
-
- /** Dumb Property */
- prop1?: string | null;
- }
-
-
- /** A representation of a dog */
- export interface Dog extends Pet {
-
- /** The size of the pack the dog is from */
- packSize: number;
- }
-
-
- /** A representation of a honey bee */
- export interface HoneyBee extends Pet {
-
- /** Average amount of honey produced per day in ounces */
- honeyPerDay: number;
- }
-
- export interface Order {
-
- /** Order ID */
- id?: string | null;
-
- /** Pet ID */
- petId?: string | null;
- quantity?: number | null;
-
- /** Estimated ship date */
- shipDate?: Date | null;
-
- /** Order Status */
- status?: OrderStatus | null;
-
- /** Indicates whenever order was completed or not */
- complete?: boolean | null;
-
- /** Unique Request Id */
- requestId?: string | null;
- }
-
- export enum OrderStatus { placed = 0, approved = 1, delivered = 2 }
-
- export interface Pet {
-
- /** Pet ID */
- id?: string | null;
-
- /** Categories this pet belongs to */
- category?: Category;
-
- /** The name given to a pet */
- name: string;
-
- /** The list of URL to a cute photos featuring pet */
- photoUrls: Array;
- friend?: Pet;
-
- /** Tags attached to the pet */
- tags?: Array;
-
- /** Pet status in the store */
- status?: PetStatus | null;
-
- /** Type of a pet */
- petType?: string | null;
- }
-
- export interface Tag {
-
- /** Tag ID */
- id?: string | null;
-
- /** Tag name */
- name?: string | null;
- }
-
- export enum PetStatus { available = 0, pending = 1, sold = 2 }
-
- export interface User {
- id?: string | null;
- pet?: Pet;
-
- /** User supplied username */
- username?: string | null;
-
- /** User first name */
- firstName?: string | null;
-
- /** User last name */
- lastName?: string | null;
-
- /** User email address */
- email?: string | null;
-
- /** User password, MUST contain a mix of upper and lower case letters, as well as digits */
- password?: string | null;
-
- /** User phone number in international format */
- phone?: string | null;
-
- /** User status */
- userStatus?: number | null;
- }
-
- @autoinject()
- export class Misc {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Add a new pet to the store
- * Add new pet to the store inventory.
- * Post pet
- * @param {Pet} requestBody Pet object that needs to be added to the store
- * @return {void}
- */
- PetPost(requestBody: Pet): Promise {
- return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Update an existing pet
- * Put pet
- * @param {Pet} requestBody Pet object that needs to be added to the store
- * @return {void}
- */
- PetPut(requestBody: Pet): Promise {
- return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Find pet by ID
- * Returns a single pet
- * Get pet/{petId}
- * @param {string} petId ID of pet to return
- * @return {Pet} successful operation
- */
- Pet_petIdGet(petId: string): Promise {
- return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Deletes a pet
- * Delete pet/{petId}
- * @param {string} petId Pet id to delete
- * @return {void}
- */
- Pet_petIdDelete(petId: string): Promise {
- return this.http.delete('pet/' + petId, {});
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * Get pet/findByStatus
- * @param {Array} status Status values that need to be considered for filter
- * @return {Array} successful operation
- */
- PetFindByStatusGetByStatus(status: Array): Promise> {
- return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * Get pet/findByTags
- * @param {Array} tags Tags to filter by
- * @return {Array} successful operation
- */
- PetFindByTagsGetByTags(tags: Array): Promise> {
- return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Returns pet inventories by status
- * Returns a map of status codes to quantities
- * Get store/inventory
- * @return {{[id: string]: number }} successful operation
- */
- StoreInventoryGet(): Promise<{[id: string]: number }> {
- return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Place an order for a pet
- * Post store/order
- * @param {Order} requestBody order placed for purchasing the pet
- * @return {Order} successful operation
- */
- StoreOrderPost(requestBody: Order): Promise {
- return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Find purchase order by ID
- * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- * Get store/order/{orderId}
- * @param {string} orderId ID of pet that needs to be fetched
- * @return {Order} successful operation
- */
- StoreOrder_orderIdGet(orderId: string): Promise {
- return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Delete purchase order by ID
- * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- * Delete store/order/{orderId}
- * @param {string} orderId ID of the order that needs to be deleted
- * @return {void}
- */
- StoreOrder_orderIdDelete(orderId: string): Promise {
- return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {});
- }
-
- /**
- * Create user
- * This can only be done by the logged in user.
- * Post user
- * @param {User} requestBody Created user object
- * @return {void}
- */
- UserPost(requestBody: User): Promise {
- return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Get user by user name
- * Get user/{username}
- * @param {string} username The name that needs to be fetched. Use user1 for testing.
- * @return {User} successful operation
- */
- User_usernameGet(username: string): Promise {
- return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Updated user
- * This can only be done by the logged in user.
- * Put user/{username}
- * @param {string} username name that need to be deleted
- * @param {User} requestBody Updated user object
- * @return {void}
- */
- User_usernamePut(username: string, requestBody: User): Promise {
- return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Delete user
- * This can only be done by the logged in user.
- * Delete user/{username}
- * @param {string} username The name that needs to be deleted
- * @return {void}
- */
- User_usernameDelete(username: string): Promise {
- return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {});
- }
-
- /**
- * Creates list of users with given input array
- * Post user/createWithArray
- * @param {Array} requestBody List of user object
- * @return {void}
- */
- UserCreateWithArrayPost(requestBody: Array): Promise {
- return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Creates list of users with given input array
- * Post user/createWithList
- * @param {Array} requestBody List of user object
- * @return {void}
- */
- UserCreateWithListPost(requestBody: Array): Promise {
- return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Logs user into the system
- * Get user/login
- * @param {string} username The user name for login
- * @param {string} password The password for login in clear text
- * @return {string} successful operation
- */
- UserLoginGetByUsernameAndPassword(username: string, password: string): Promise {
- return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;});
- }
-
- /**
- * Logs out current logged in user session
- * Get user/logout
- * @return {void}
- */
- UserLogoutGet(): Promise {
- return this.http.get('user/logout', {});
- }
- }
-
-}
-
+import {HttpClient} from 'aurelia-fetch-client';
+import {autoinject} from 'aurelia-framework';
+export namespace MyNS {
+ export interface ApiResponse {
+ code?: number | null;
+ type?: string | null;
+ message?: string | null;
+ }
+
+
+ /** A representation of a cat */
+ export interface Cat extends Pet {
+
+ /** The measured skill for hunting */
+ huntingSkill: CatHuntingSkill;
+ }
+
+ export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 }
+
+ export interface Category {
+
+ /** Category ID */
+ id?: string | null;
+
+ /** Category name */
+ name?: string | null;
+
+ /** Test Sub Category */
+ sub?: CategorySub;
+ }
+
+ export interface CategorySub {
+
+ /** Dumb Property */
+ prop1?: string | null;
+ }
+
+
+ /** A representation of a dog */
+ export interface Dog extends Pet {
+
+ /** The size of the pack the dog is from */
+ packSize: number;
+ }
+
+
+ /** A representation of a honey bee */
+ export interface HoneyBee extends Pet {
+
+ /** Average amount of honey produced per day in ounces */
+ honeyPerDay: number;
+ }
+
+ export interface Order {
+
+ /** Order ID */
+ id?: string | null;
+
+ /** Pet ID */
+ petId?: string | null;
+ quantity?: number | null;
+
+ /** Estimated ship date */
+ shipDate?: Date | null;
+
+ /** Order Status */
+ status?: OrderStatus | null;
+
+ /** Indicates whenever order was completed or not */
+ complete?: boolean | null;
+
+ /** Unique Request Id */
+ requestId?: string | null;
+ }
+
+ export enum OrderStatus { placed = 0, approved = 1, delivered = 2 }
+
+ export interface Pet {
+
+ /** Pet ID */
+ id?: string | null;
+
+ /** Categories this pet belongs to */
+ category?: Category;
+
+ /** The name given to a pet */
+ name: string;
+
+ /** The list of URL to a cute photos featuring pet */
+ photoUrls: Array;
+ friend?: Pet;
+
+ /** Tags attached to the pet */
+ tags?: Array;
+
+ /** Pet status in the store */
+ status?: PetStatus | null;
+
+ /** Type of a pet */
+ petType?: string | null;
+ }
+
+ export interface Tag {
+
+ /** Tag ID */
+ id?: string | null;
+
+ /** Tag name */
+ name?: string | null;
+ }
+
+ export enum PetStatus { available = 0, pending = 1, sold = 2 }
+
+ export interface User {
+ id?: string | null;
+ pet?: Pet;
+
+ /** User supplied username */
+ username?: string | null;
+
+ /** User first name */
+ firstName?: string | null;
+
+ /** User last name */
+ lastName?: string | null;
+
+ /** User email address */
+ email?: string | null;
+
+ /** User password, MUST contain a mix of upper and lower case letters, as well as digits */
+ password?: string | null;
+
+ /** User phone number in international format */
+ phone?: string | null;
+
+ /** User status */
+ userStatus?: number | null;
+ }
+
+ @autoinject()
+ export class Misc {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Add a new pet to the store
+ * Add new pet to the store inventory.
+ * Post pet
+ * @param {Pet} requestBody Pet object that needs to be added to the store
+ * @return {void}
+ */
+ PetPost(requestBody: Pet): Promise {
+ return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Update an existing pet
+ * Put pet
+ * @param {Pet} requestBody Pet object that needs to be added to the store
+ * @return {void}
+ */
+ PetPut(requestBody: Pet): Promise {
+ return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ * Get pet/{petId}
+ * @param {string} petId ID of pet to return
+ * @return {Pet} successful operation
+ */
+ Pet_petIdGet(petId: string): Promise {
+ return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Deletes a pet
+ * Delete pet/{petId}
+ * @param {string} petId Pet id to delete
+ * @return {void}
+ */
+ Pet_petIdDelete(petId: string): Promise {
+ return this.http.delete('pet/' + petId, {});
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * Get pet/findByStatus
+ * @param {Array} status Status values that need to be considered for filter
+ * @return {Array} successful operation
+ */
+ PetFindByStatusGetByStatus(status: Array): Promise> {
+ return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * Get pet/findByTags
+ * @param {Array} tags Tags to filter by
+ * @return {Array} successful operation
+ */
+ PetFindByTagsGetByTags(tags: Array): Promise> {
+ return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ * Get store/inventory
+ * @return {{[id: string]: number }} successful operation
+ */
+ StoreInventoryGet(): Promise<{[id: string]: number }> {
+ return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Place an order for a pet
+ * Post store/order
+ * @param {Order} requestBody order placed for purchasing the pet
+ * @return {Order} successful operation
+ */
+ StoreOrderPost(requestBody: Order): Promise {
+ return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Find purchase order by ID
+ * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ * Get store/order/{orderId}
+ * @param {string} orderId ID of pet that needs to be fetched
+ * @return {Order} successful operation
+ */
+ StoreOrder_orderIdGet(orderId: string): Promise {
+ return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ * Delete store/order/{orderId}
+ * @param {string} orderId ID of the order that needs to be deleted
+ * @return {void}
+ */
+ StoreOrder_orderIdDelete(orderId: string): Promise {
+ return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {});
+ }
+
+ /**
+ * Create user
+ * This can only be done by the logged in user.
+ * Post user
+ * @param {User} requestBody Created user object
+ * @return {void}
+ */
+ UserPost(requestBody: User): Promise {
+ return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Get user by user name
+ * Get user/{username}
+ * @param {string} username The name that needs to be fetched. Use user1 for testing.
+ * @return {User} successful operation
+ */
+ User_usernameGet(username: string): Promise {
+ return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Updated user
+ * This can only be done by the logged in user.
+ * Put user/{username}
+ * @param {string} username name that need to be deleted
+ * @param {User} requestBody Updated user object
+ * @return {void}
+ */
+ User_usernamePut(username: string, requestBody: User): Promise {
+ return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Delete user
+ * This can only be done by the logged in user.
+ * Delete user/{username}
+ * @param {string} username The name that needs to be deleted
+ * @return {void}
+ */
+ User_usernameDelete(username: string): Promise {
+ return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {});
+ }
+
+ /**
+ * Creates list of users with given input array
+ * Post user/createWithArray
+ * @param {Array} requestBody List of user object
+ * @return {void}
+ */
+ UserCreateWithArrayPost(requestBody: Array): Promise {
+ return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Creates list of users with given input array
+ * Post user/createWithList
+ * @param {Array} requestBody List of user object
+ * @return {void}
+ */
+ UserCreateWithListPost(requestBody: Array): Promise {
+ return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Logs user into the system
+ * Get user/login
+ * @param {string} username The user name for login
+ * @param {string} password The password for login in clear text
+ * @return {string} successful operation
+ */
+ UserLoginGetByUsernameAndPassword(username: string, password: string): Promise {
+ return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;});
+ }
+
+ /**
+ * Logs out current logged in user session
+ * Get user/logout
+ * @return {void}
+ */
+ UserLogoutGet(): Promise {
+ return this.http.get('user/logout', {});
+ }
+ }
+
+}
+
diff --git a/Tests/SwagTsTests/AureliaResults/PetPathAsContainer.txt b/Tests/SwagTsTests/AureliaResults/PetPathAsContainer.ts
similarity index 96%
rename from Tests/SwagTsTests/AureliaResults/PetPathAsContainer.txt
rename to Tests/SwagTsTests/AureliaResults/PetPathAsContainer.ts
index baec2e21..76d87d79 100644
--- a/Tests/SwagTsTests/AureliaResults/PetPathAsContainer.txt
+++ b/Tests/SwagTsTests/AureliaResults/PetPathAsContainer.ts
@@ -1,415 +1,415 @@
-import {HttpClient} from 'aurelia-fetch-client';
-import {autoinject} from 'aurelia-framework';
-export namespace MyNS {
- export interface ApiResponse {
- code?: number | null;
- type?: string | null;
- message?: string | null;
- }
-
-
- /** A representation of a cat */
- export interface Cat extends Pet {
-
- /** The measured skill for hunting */
- huntingSkill: CatHuntingSkill;
- }
-
- export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 }
-
- export interface Category {
-
- /** Category ID */
- id?: string | null;
-
- /** Category name */
- name?: string | null;
-
- /** Test Sub Category */
- sub?: CategorySub;
- }
-
- export interface CategorySub {
-
- /** Dumb Property */
- prop1?: string | null;
- }
-
-
- /** A representation of a dog */
- export interface Dog extends Pet {
-
- /** The size of the pack the dog is from */
- packSize: number;
- }
-
-
- /** A representation of a honey bee */
- export interface HoneyBee extends Pet {
-
- /** Average amount of honey produced per day in ounces */
- honeyPerDay: number;
- }
-
- export interface Order {
-
- /** Order ID */
- id?: string | null;
-
- /** Pet ID */
- petId?: string | null;
- quantity?: number | null;
-
- /** Estimated ship date */
- shipDate?: Date | null;
-
- /** Order Status */
- status?: OrderStatus | null;
-
- /** Indicates whenever order was completed or not */
- complete?: boolean | null;
-
- /** Unique Request Id */
- requestId?: string | null;
- }
-
- export enum OrderStatus { placed = 0, approved = 1, delivered = 2 }
-
- export interface Pet {
-
- /** Pet ID */
- id?: string | null;
-
- /** Categories this pet belongs to */
- category?: Category;
-
- /** The name given to a pet */
- name: string;
-
- /** The list of URL to a cute photos featuring pet */
- photoUrls: Array;
- friend?: Pet;
-
- /** Tags attached to the pet */
- tags?: Array;
-
- /** Pet status in the store */
- status?: PetStatus | null;
-
- /** Type of a pet */
- petType?: string | null;
- }
-
- export interface Tag {
-
- /** Tag ID */
- id?: string | null;
-
- /** Tag name */
- name?: string | null;
- }
-
- export enum PetStatus { available = 0, pending = 1, sold = 2 }
-
- export interface User {
- id?: string | null;
- pet?: Pet;
-
- /** User supplied username */
- username?: string | null;
-
- /** User first name */
- firstName?: string | null;
-
- /** User last name */
- lastName?: string | null;
-
- /** User email address */
- email?: string | null;
-
- /** User password, MUST contain a mix of upper and lower case letters, as well as digits */
- password?: string | null;
-
- /** User phone number in international format */
- phone?: string | null;
-
- /** User status */
- userStatus?: number | null;
- }
-
- @autoinject()
- export class PetClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Add a new pet to the store
- * Add new pet to the store inventory.
- * Post pet
- * @param {Pet} requestBody Pet object that needs to be added to the store
- * @return {void}
- */
- Post(requestBody: Pet): Promise {
- return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Update an existing pet
- * Put pet
- * @param {Pet} requestBody Pet object that needs to be added to the store
- * @return {void}
- */
- Put(requestBody: Pet): Promise {
- return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
- }
-
- @autoinject()
- export class Pet_petIdClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Find pet by ID
- * Returns a single pet
- * Get pet/{petId}
- * @param {string} petId ID of pet to return
- * @return {Pet} successful operation
- */
- GetByPetId(petId: string): Promise {
- return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Deletes a pet
- * Delete pet/{petId}
- * @param {string} petId Pet id to delete
- * @return {void}
- */
- DeleteByPetId(petId: string): Promise {
- return this.http.delete('pet/' + petId, {});
- }
- }
-
- @autoinject()
- export class Pet_petIdUploadImageClient {
- constructor(private http: HttpClient) {
- }
- }
-
- @autoinject()
- export class PetFindByStatusClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * Get pet/findByStatus
- * @param {Array} status Status values that need to be considered for filter
- * @return {Array} successful operation
- */
- GetByStatus(status: Array): Promise> {
- return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
- }
-
- @autoinject()
- export class PetFindByTagsClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * Get pet/findByTags
- * @param {Array} tags Tags to filter by
- * @return {Array} successful operation
- */
- GetByTags(tags: Array): Promise> {
- return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
- }
-
- @autoinject()
- export class StoreInventoryClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Returns pet inventories by status
- * Returns a map of status codes to quantities
- * Get store/inventory
- * @return {{[id: string]: number }} successful operation
- */
- Get(): Promise<{[id: string]: number }> {
- return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
- }
-
- @autoinject()
- export class StoreOrderClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Place an order for a pet
- * Post store/order
- * @param {Order} requestBody order placed for purchasing the pet
- * @return {Order} successful operation
- */
- Post(requestBody: Order): Promise {
- return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
- }
-
- @autoinject()
- export class StoreOrder_orderIdClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Find purchase order by ID
- * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- * Get store/order/{orderId}
- * @param {string} orderId ID of pet that needs to be fetched
- * @return {Order} successful operation
- */
- GetByOrderId(orderId: string): Promise {
- return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Delete purchase order by ID
- * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- * Delete store/order/{orderId}
- * @param {string} orderId ID of the order that needs to be deleted
- * @return {void}
- */
- DeleteByOrderId(orderId: string): Promise {
- return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {});
- }
- }
-
- @autoinject()
- export class UserClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Create user
- * This can only be done by the logged in user.
- * Post user
- * @param {User} requestBody Created user object
- * @return {void}
- */
- Post(requestBody: User): Promise {
- return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
- }
-
- @autoinject()
- export class User_usernameClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Get user by user name
- * Get user/{username}
- * @param {string} username The name that needs to be fetched. Use user1 for testing.
- * @return {User} successful operation
- */
- GetByUsername(username: string): Promise {
- return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Updated user
- * This can only be done by the logged in user.
- * Put user/{username}
- * @param {string} username name that need to be deleted
- * @param {User} requestBody Updated user object
- * @return {void}
- */
- PutByUsername(username: string, requestBody: User): Promise {
- return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Delete user
- * This can only be done by the logged in user.
- * Delete user/{username}
- * @param {string} username The name that needs to be deleted
- * @return {void}
- */
- DeleteByUsername(username: string): Promise {
- return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {});
- }
- }
-
- @autoinject()
- export class UserCreateWithArrayClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Creates list of users with given input array
- * Post user/createWithArray
- * @param {Array} requestBody List of user object
- * @return {void}
- */
- Post(requestBody: Array): Promise {
- return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
- }
-
- @autoinject()
- export class UserCreateWithListClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Creates list of users with given input array
- * Post user/createWithList
- * @param {Array} requestBody List of user object
- * @return {void}
- */
- Post(requestBody: Array): Promise {
- return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
- }
-
- @autoinject()
- export class UserLoginClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Logs user into the system
- * Get user/login
- * @param {string} username The user name for login
- * @param {string} password The password for login in clear text
- * @return {string} successful operation
- */
- GetByUsernameAndPassword(username: string, password: string): Promise {
- return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;});
- }
- }
-
- @autoinject()
- export class UserLogoutClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Logs out current logged in user session
- * Get user/logout
- * @return {void}
- */
- Get(): Promise {
- return this.http.get('user/logout', {});
- }
- }
-
-}
-
+import {HttpClient} from 'aurelia-fetch-client';
+import {autoinject} from 'aurelia-framework';
+export namespace MyNS {
+ export interface ApiResponse {
+ code?: number | null;
+ type?: string | null;
+ message?: string | null;
+ }
+
+
+ /** A representation of a cat */
+ export interface Cat extends Pet {
+
+ /** The measured skill for hunting */
+ huntingSkill: CatHuntingSkill;
+ }
+
+ export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 }
+
+ export interface Category {
+
+ /** Category ID */
+ id?: string | null;
+
+ /** Category name */
+ name?: string | null;
+
+ /** Test Sub Category */
+ sub?: CategorySub;
+ }
+
+ export interface CategorySub {
+
+ /** Dumb Property */
+ prop1?: string | null;
+ }
+
+
+ /** A representation of a dog */
+ export interface Dog extends Pet {
+
+ /** The size of the pack the dog is from */
+ packSize: number;
+ }
+
+
+ /** A representation of a honey bee */
+ export interface HoneyBee extends Pet {
+
+ /** Average amount of honey produced per day in ounces */
+ honeyPerDay: number;
+ }
+
+ export interface Order {
+
+ /** Order ID */
+ id?: string | null;
+
+ /** Pet ID */
+ petId?: string | null;
+ quantity?: number | null;
+
+ /** Estimated ship date */
+ shipDate?: Date | null;
+
+ /** Order Status */
+ status?: OrderStatus | null;
+
+ /** Indicates whenever order was completed or not */
+ complete?: boolean | null;
+
+ /** Unique Request Id */
+ requestId?: string | null;
+ }
+
+ export enum OrderStatus { placed = 0, approved = 1, delivered = 2 }
+
+ export interface Pet {
+
+ /** Pet ID */
+ id?: string | null;
+
+ /** Categories this pet belongs to */
+ category?: Category;
+
+ /** The name given to a pet */
+ name: string;
+
+ /** The list of URL to a cute photos featuring pet */
+ photoUrls: Array;
+ friend?: Pet;
+
+ /** Tags attached to the pet */
+ tags?: Array;
+
+ /** Pet status in the store */
+ status?: PetStatus | null;
+
+ /** Type of a pet */
+ petType?: string | null;
+ }
+
+ export interface Tag {
+
+ /** Tag ID */
+ id?: string | null;
+
+ /** Tag name */
+ name?: string | null;
+ }
+
+ export enum PetStatus { available = 0, pending = 1, sold = 2 }
+
+ export interface User {
+ id?: string | null;
+ pet?: Pet;
+
+ /** User supplied username */
+ username?: string | null;
+
+ /** User first name */
+ firstName?: string | null;
+
+ /** User last name */
+ lastName?: string | null;
+
+ /** User email address */
+ email?: string | null;
+
+ /** User password, MUST contain a mix of upper and lower case letters, as well as digits */
+ password?: string | null;
+
+ /** User phone number in international format */
+ phone?: string | null;
+
+ /** User status */
+ userStatus?: number | null;
+ }
+
+ @autoinject()
+ export class PetClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Add a new pet to the store
+ * Add new pet to the store inventory.
+ * Post pet
+ * @param {Pet} requestBody Pet object that needs to be added to the store
+ * @return {void}
+ */
+ Post(requestBody: Pet): Promise {
+ return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Update an existing pet
+ * Put pet
+ * @param {Pet} requestBody Pet object that needs to be added to the store
+ * @return {void}
+ */
+ Put(requestBody: Pet): Promise {
+ return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+ }
+
+ @autoinject()
+ export class Pet_petIdClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ * Get pet/{petId}
+ * @param {string} petId ID of pet to return
+ * @return {Pet} successful operation
+ */
+ GetByPetId(petId: string): Promise {
+ return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Deletes a pet
+ * Delete pet/{petId}
+ * @param {string} petId Pet id to delete
+ * @return {void}
+ */
+ DeleteByPetId(petId: string): Promise {
+ return this.http.delete('pet/' + petId, {});
+ }
+ }
+
+ @autoinject()
+ export class Pet_petIdUploadImageClient {
+ constructor(private http: HttpClient) {
+ }
+ }
+
+ @autoinject()
+ export class PetFindByStatusClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * Get pet/findByStatus
+ * @param {Array} status Status values that need to be considered for filter
+ * @return {Array} successful operation
+ */
+ GetByStatus(status: Array): Promise> {
+ return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+ }
+
+ @autoinject()
+ export class PetFindByTagsClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * Get pet/findByTags
+ * @param {Array} tags Tags to filter by
+ * @return {Array} successful operation
+ */
+ GetByTags(tags: Array): Promise> {
+ return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+ }
+
+ @autoinject()
+ export class StoreInventoryClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ * Get store/inventory
+ * @return {{[id: string]: number }} successful operation
+ */
+ Get(): Promise<{[id: string]: number }> {
+ return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+ }
+
+ @autoinject()
+ export class StoreOrderClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Place an order for a pet
+ * Post store/order
+ * @param {Order} requestBody order placed for purchasing the pet
+ * @return {Order} successful operation
+ */
+ Post(requestBody: Order): Promise {
+ return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+ }
+
+ @autoinject()
+ export class StoreOrder_orderIdClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Find purchase order by ID
+ * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ * Get store/order/{orderId}
+ * @param {string} orderId ID of pet that needs to be fetched
+ * @return {Order} successful operation
+ */
+ GetByOrderId(orderId: string): Promise {
+ return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ * Delete store/order/{orderId}
+ * @param {string} orderId ID of the order that needs to be deleted
+ * @return {void}
+ */
+ DeleteByOrderId(orderId: string): Promise {
+ return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {});
+ }
+ }
+
+ @autoinject()
+ export class UserClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Create user
+ * This can only be done by the logged in user.
+ * Post user
+ * @param {User} requestBody Created user object
+ * @return {void}
+ */
+ Post(requestBody: User): Promise {
+ return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+ }
+
+ @autoinject()
+ export class User_usernameClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Get user by user name
+ * Get user/{username}
+ * @param {string} username The name that needs to be fetched. Use user1 for testing.
+ * @return {User} successful operation
+ */
+ GetByUsername(username: string): Promise {
+ return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Updated user
+ * This can only be done by the logged in user.
+ * Put user/{username}
+ * @param {string} username name that need to be deleted
+ * @param {User} requestBody Updated user object
+ * @return {void}
+ */
+ PutByUsername(username: string, requestBody: User): Promise {
+ return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Delete user
+ * This can only be done by the logged in user.
+ * Delete user/{username}
+ * @param {string} username The name that needs to be deleted
+ * @return {void}
+ */
+ DeleteByUsername(username: string): Promise {
+ return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {});
+ }
+ }
+
+ @autoinject()
+ export class UserCreateWithArrayClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Creates list of users with given input array
+ * Post user/createWithArray
+ * @param {Array} requestBody List of user object
+ * @return {void}
+ */
+ Post(requestBody: Array): Promise {
+ return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+ }
+
+ @autoinject()
+ export class UserCreateWithListClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Creates list of users with given input array
+ * Post user/createWithList
+ * @param {Array} requestBody List of user object
+ * @return {void}
+ */
+ Post(requestBody: Array): Promise {
+ return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+ }
+
+ @autoinject()
+ export class UserLoginClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Logs user into the system
+ * Get user/login
+ * @param {string} username The user name for login
+ * @param {string} password The password for login in clear text
+ * @return {string} successful operation
+ */
+ GetByUsernameAndPassword(username: string, password: string): Promise {
+ return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;});
+ }
+ }
+
+ @autoinject()
+ export class UserLogoutClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Logs out current logged in user session
+ * Get user/logout
+ * @return {void}
+ */
+ Get(): Promise {
+ return this.http.get('user/logout', {});
+ }
+ }
+
+}
+
diff --git a/Tests/SwagTsTests/AureliaResults/PetStore.txt b/Tests/SwagTsTests/AureliaResults/PetStore.ts
similarity index 97%
rename from Tests/SwagTsTests/AureliaResults/PetStore.txt
rename to Tests/SwagTsTests/AureliaResults/PetStore.ts
index 4ec63f75..87e83972 100644
--- a/Tests/SwagTsTests/AureliaResults/PetStore.txt
+++ b/Tests/SwagTsTests/AureliaResults/PetStore.ts
@@ -1,315 +1,315 @@
-import {HttpClient} from 'aurelia-fetch-client';
-import {autoinject} from 'aurelia-framework';
-export namespace MyNS {
- export interface Order {
-
- /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
- id?: string | null;
-
- /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
- petId?: string | null;
-
- /** Type: int, -2,147,483,648 to 2,147,483,647 */
- quantity?: number | null;
- shipDate?: Date | null;
-
- /** Order Status */
- status?: OrderStatus | null;
- complete?: boolean | null;
- }
-
- export enum OrderStatus { placed = 0, approved = 1, delivered = 2 }
-
- export interface Customer {
-
- /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
- id?: string | null;
- username?: string | null;
- address?: Array;
- }
-
- export interface Address {
- street?: string | null;
- city?: string | null;
- state?: string | null;
- zip?: string | null;
- }
-
- export interface Category {
-
- /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
- id?: string | null;
- name?: string | null;
- }
-
- export interface User {
-
- /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
- id?: string | null;
- username?: string | null;
- firstName?: string | null;
- lastName?: string | null;
- email?: string | null;
- password?: string | null;
- phone?: string | null;
-
- /**
- * User Status
- * Type: int, -2,147,483,648 to 2,147,483,647
- */
- userStatus?: number | null;
- }
-
- export interface Tag {
-
- /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
- id?: string | null;
- name?: string | null;
- }
-
- export interface Pet {
-
- /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
- id?: string | null;
-
- /** Required */
- name: string;
- category?: Category;
-
- /** Required */
- photoUrls: Array;
- tags?: Array;
-
- /** pet status in the store */
- status?: PetStatus | null;
- }
-
- export enum PetStatus { available = 0, pending = 1, sold = 2 }
-
- export interface ApiResponse {
-
- /** Type: int, -2,147,483,648 to 2,147,483,647 */
- code?: number | null;
- type?: string | null;
- message?: string | null;
- }
-
- @autoinject()
- export class PetClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Update an existing pet
- * Update an existing pet by Id
- * Put pet
- * @param {Pet} requestBody Update an existent pet in the store
- * @return {Pet} Successful operation
- */
- UpdatePet(requestBody: Pet): Promise {
- return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Add a new pet to the store
- * Add a new pet to the store
- * Post pet
- * @param {Pet} requestBody Create a new pet in the store
- * @return {Pet} Successful operation
- */
- AddPet(requestBody: Pet): Promise {
- return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * Get pet/findByStatus
- * @param {PetStatus} status Status values that need to be considered for filter
- * @return {Array} successful operation
- */
- FindPetsByStatus(status: PetStatus | null | undefined): Promise> {
- return this.http.get('pet/findByStatus?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * Get pet/findByTags
- * @param {Array} tags Tags to filter by
- * @return {Array} successful operation
- */
- FindPetsByTags(tags: Array | null | undefined): Promise> {
- return this.http.get('pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Find pet by ID
- * Returns a single pet
- * Get pet/{petId}
- * @param {string} petId ID of pet to return
- * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
- * @return {Pet} successful operation
- */
- GetPetById(petId: string): Promise {
- return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Updates a pet in the store with form data
- * Post pet/{petId}
- * @param {string} petId ID of pet that needs to be updated
- * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
- * @param {string} name Name of pet that needs to be updated
- * @param {string} status Status of pet that needs to be updated
- * @return {void}
- */
- UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Promise {
- return this.http.post('pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, {});
- }
-
- /**
- * Deletes a pet
- * delete a pet
- * Delete pet/{petId}
- * @param {string} petId Pet id to delete
- * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
- * @return {void}
- */
- DeletePet(petId: string): Promise {
- return this.http.delete('pet/' + petId, {});
- }
- }
-
- @autoinject()
- export class StoreClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Returns pet inventories by status
- * Returns a map of status codes to quantities
- * Get store/inventory
- * @return {{[id: string]: number }} successful operation
- */
- GetInventory(): Promise<{[id: string]: number }> {
- return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Place an order for a pet
- * Place a new order in the store
- * Post store/order
- * @return {Order} successful operation
- */
- PlaceOrder(requestBody: Order): Promise {
- return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Find purchase order by ID
- * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
- * Get store/order/{orderId}
- * @param {string} orderId ID of order that needs to be fetched
- * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
- * @return {Order} successful operation
- */
- GetOrderById(orderId: string): Promise {
- return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Delete purchase order by ID
- * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- * Delete store/order/{orderId}
- * @param {string} orderId ID of the order that needs to be deleted
- * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
- * @return {void}
- */
- DeleteOrder(orderId: string): Promise {
- return this.http.delete('store/order/' + orderId, {});
- }
- }
-
- @autoinject()
- export class UserClient {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Create user
- * This can only be done by the logged in user.
- * Post user
- * @param {User} requestBody Created user object
- * @return {void}
- */
- CreateUser(requestBody: User): Promise {
- return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Creates list of users with given input array
- * Creates list of users with given input array
- * Post user/createWithList
- * @return {User} Successful operation
- */
- CreateUsersWithListInput(requestBody: Array): Promise {
- return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Logs user into the system
- * Get user/login
- * @param {string} username The user name for login
- * @param {string} password The password for login in clear text
- * @return {string} successful operation
- */
- LoginUser(username: string | null | undefined, password: string | null | undefined): Promise {
- return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;});
- }
-
- /**
- * Logs out current logged in user session
- * Get user/logout
- * @return {void}
- */
- LogoutUser(): Promise {
- return this.http.get('user/logout', {});
- }
-
- /**
- * Get user by user name
- * Get user/{username}
- * @param {string} username The name that needs to be fetched. Use user1 for testing.
- * @return {User} successful operation
- */
- GetUserByName(username: string): Promise {
- return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Update user
- * This can only be done by the logged in user.
- * Put user/{username}
- * @param {string} username name that need to be deleted
- * @param {User} requestBody Update an existent user in the store
- * @return {void}
- */
- UpdateUser(username: string, requestBody: User): Promise {
- return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
- }
-
- /**
- * Delete user
- * This can only be done by the logged in user.
- * Delete user/{username}
- * @param {string} username The name that needs to be deleted
- * @return {void}
- */
- DeleteUser(username: string): Promise {
- return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {});
- }
- }
-
-}
-
+import {HttpClient} from 'aurelia-fetch-client';
+import {autoinject} from 'aurelia-framework';
+export namespace MyNS {
+ export interface Order {
+
+ /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
+ id?: string | null;
+
+ /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
+ petId?: string | null;
+
+ /** Type: int, -2,147,483,648 to 2,147,483,647 */
+ quantity?: number | null;
+ shipDate?: Date | null;
+
+ /** Order Status */
+ status?: OrderStatus | null;
+ complete?: boolean | null;
+ }
+
+ export enum OrderStatus { placed = 0, approved = 1, delivered = 2 }
+
+ export interface Customer {
+
+ /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
+ id?: string | null;
+ username?: string | null;
+ address?: Array;
+ }
+
+ export interface Address {
+ street?: string | null;
+ city?: string | null;
+ state?: string | null;
+ zip?: string | null;
+ }
+
+ export interface Category {
+
+ /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
+ id?: string | null;
+ name?: string | null;
+ }
+
+ export interface User {
+
+ /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
+ id?: string | null;
+ username?: string | null;
+ firstName?: string | null;
+ lastName?: string | null;
+ email?: string | null;
+ password?: string | null;
+ phone?: string | null;
+
+ /**
+ * User Status
+ * Type: int, -2,147,483,648 to 2,147,483,647
+ */
+ userStatus?: number | null;
+ }
+
+ export interface Tag {
+
+ /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
+ id?: string | null;
+ name?: string | null;
+ }
+
+ export interface Pet {
+
+ /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */
+ id?: string | null;
+
+ /** Required */
+ name: string;
+ category?: Category;
+
+ /** Required */
+ photoUrls: Array;
+ tags?: Array;
+
+ /** pet status in the store */
+ status?: PetStatus | null;
+ }
+
+ export enum PetStatus { available = 0, pending = 1, sold = 2 }
+
+ export interface ApiResponse {
+
+ /** Type: int, -2,147,483,648 to 2,147,483,647 */
+ code?: number | null;
+ type?: string | null;
+ message?: string | null;
+ }
+
+ @autoinject()
+ export class PetClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Update an existing pet
+ * Update an existing pet by Id
+ * Put pet
+ * @param {Pet} requestBody Update an existent pet in the store
+ * @return {Pet} Successful operation
+ */
+ UpdatePet(requestBody: Pet): Promise {
+ return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Add a new pet to the store
+ * Add a new pet to the store
+ * Post pet
+ * @param {Pet} requestBody Create a new pet in the store
+ * @return {Pet} Successful operation
+ */
+ AddPet(requestBody: Pet): Promise {
+ return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * Get pet/findByStatus
+ * @param {PetStatus} status Status values that need to be considered for filter
+ * @return {Array} successful operation
+ */
+ FindPetsByStatus(status: PetStatus | null | undefined): Promise> {
+ return this.http.get('pet/findByStatus?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * Get pet/findByTags
+ * @param {Array} tags Tags to filter by
+ * @return {Array} successful operation
+ */
+ FindPetsByTags(tags: Array | null | undefined): Promise> {
+ return this.http.get('pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ * Get pet/{petId}
+ * @param {string} petId ID of pet to return
+ * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
+ * @return {Pet} successful operation
+ */
+ GetPetById(petId: string): Promise {
+ return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Updates a pet in the store with form data
+ * Post pet/{petId}
+ * @param {string} petId ID of pet that needs to be updated
+ * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
+ * @param {string} name Name of pet that needs to be updated
+ * @param {string} status Status of pet that needs to be updated
+ * @return {void}
+ */
+ UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Promise {
+ return this.http.post('pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, {});
+ }
+
+ /**
+ * Deletes a pet
+ * delete a pet
+ * Delete pet/{petId}
+ * @param {string} petId Pet id to delete
+ * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
+ * @return {void}
+ */
+ DeletePet(petId: string): Promise {
+ return this.http.delete('pet/' + petId, {});
+ }
+ }
+
+ @autoinject()
+ export class StoreClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ * Get store/inventory
+ * @return {{[id: string]: number }} successful operation
+ */
+ GetInventory(): Promise<{[id: string]: number }> {
+ return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Place an order for a pet
+ * Place a new order in the store
+ * Post store/order
+ * @return {Order} successful operation
+ */
+ PlaceOrder(requestBody: Order): Promise {
+ return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Find purchase order by ID
+ * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
+ * Get store/order/{orderId}
+ * @param {string} orderId ID of order that needs to be fetched
+ * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
+ * @return {Order} successful operation
+ */
+ GetOrderById(orderId: string): Promise {
+ return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ * Delete store/order/{orderId}
+ * @param {string} orderId ID of the order that needs to be deleted
+ * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
+ * @return {void}
+ */
+ DeleteOrder(orderId: string): Promise {
+ return this.http.delete('store/order/' + orderId, {});
+ }
+ }
+
+ @autoinject()
+ export class UserClient {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Create user
+ * This can only be done by the logged in user.
+ * Post user
+ * @param {User} requestBody Created user object
+ * @return {void}
+ */
+ CreateUser(requestBody: User): Promise {
+ return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Creates list of users with given input array
+ * Creates list of users with given input array
+ * Post user/createWithList
+ * @return {User} Successful operation
+ */
+ CreateUsersWithListInput(requestBody: Array): Promise {
+ return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Logs user into the system
+ * Get user/login
+ * @param {string} username The user name for login
+ * @param {string} password The password for login in clear text
+ * @return {string} successful operation
+ */
+ LoginUser(username: string | null | undefined, password: string | null | undefined): Promise {
+ return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;});
+ }
+
+ /**
+ * Logs out current logged in user session
+ * Get user/logout
+ * @return {void}
+ */
+ LogoutUser(): Promise {
+ return this.http.get('user/logout', {});
+ }
+
+ /**
+ * Get user by user name
+ * Get user/{username}
+ * @param {string} username The name that needs to be fetched. Use user1 for testing.
+ * @return {User} successful operation
+ */
+ GetUserByName(username: string): Promise {
+ return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;});
+ }
+
+ /**
+ * Update user
+ * This can only be done by the logged in user.
+ * Put user/{username}
+ * @param {string} username name that need to be deleted
+ * @param {User} requestBody Update an existent user in the store
+ * @return {void}
+ */
+ UpdateUser(username: string, requestBody: User): Promise {
+ return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } });
+ }
+
+ /**
+ * Delete user
+ * This can only be done by the logged in user.
+ * Delete user/{username}
+ * @param {string} username The name that needs to be deleted
+ * @return {void}
+ */
+ DeleteUser(username: string): Promise {
+ return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {});
+ }
+ }
+
+}
+
diff --git a/Tests/SwagTsTests/AureliaResults/PetStoreExpanded.txt b/Tests/SwagTsTests/AureliaResults/PetStoreExpanded.ts
similarity index 98%
rename from Tests/SwagTsTests/AureliaResults/PetStoreExpanded.txt
rename to Tests/SwagTsTests/AureliaResults/PetStoreExpanded.ts
index 40cc9ec4..0299c5ae 100644
--- a/Tests/SwagTsTests/AureliaResults/PetStoreExpanded.txt
+++ b/Tests/SwagTsTests/AureliaResults/PetStoreExpanded.ts
@@ -1,68 +1,68 @@
-import {HttpClient} from 'aurelia-fetch-client';
-import {autoinject} from 'aurelia-framework';
-export namespace MyNS {
- export interface Pet extends NewPet {
- id: string;
- }
-
- export interface NewPet {
- name: string;
- tag?: string | null;
- }
-
- export interface Error {
- code: number;
- message: string;
- }
-
- @autoinject()
- export class Misc {
- constructor(private http: HttpClient) {
- }
-
- /**
- * Returns all pets from the system that the user has access to
- * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.
- * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.
- * Get pets
- * @param {Array} tags tags to filter by
- * @param {number} limit maximum number of results to return
- * @return {Array} pet response
- */
- FindPets(tags: Array | null | undefined, limit: number | null | undefined): Promise> {
- return this.http.get('pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Creates a new pet in the store. Duplicates are allowed
- * Post pets
- * @param {NewPet} requestBody Pet to add to the store
- * @return {Pet} pet response
- */
- AddPet(requestBody: NewPet): Promise {
- return this.http.post('pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * Returns a user based on a single ID, if the user does not have access to the pet
- * Get pets/{id}
- * @param {string} id ID of pet to fetch
- * @return {Pet} pet response
- */
- FindPetById(id: string): Promise {
- return this.http.get('pets/' + id, {}).then(d => {if (d.status<=204) return d.json(); throw d;});
- }
-
- /**
- * deletes a single pet based on the ID supplied
- * Delete pets/{id}
- * @param {string} id ID of pet to delete
- * @return {void}
- */
- DeletePet(id: string): Promise {
- return this.http.delete('pets/' + id, {});
- }
- }
-
-}
-
+import {HttpClient} from 'aurelia-fetch-client';
+import {autoinject} from 'aurelia-framework';
+export namespace MyNS {
+ export interface Pet extends NewPet {
+ id: string;
+ }
+
+ export interface NewPet {
+ name: string;
+ tag?: string | null;
+ }
+
+ export interface Error {
+ code: number;
+ message: string;
+ }
+
+ @autoinject()
+ export class Misc {
+ constructor(private http: HttpClient) {
+ }
+
+ /**
+ * Returns all pets from the system that the user has access to
+ * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.
+ * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.
+ * Get pets
+ * @param {Array