From c607ea8b31d1aca7e5c5323f0aeb9e5dc6709970 Mon Sep 17 00:00:00 2001 From: delenius Date: Sat, 16 Jun 2018 10:59:23 -0700 Subject: [PATCH] Add fixes for es6 generator (#180) Various fixes for JS (ES6) generator --- .../languages/JavascriptClientCodegen.java | 5 + .../main/resources/Javascript/api.mustache | 2 +- .../Javascript/es6/ApiClient.mustache | 77 ++-- .../resources/Javascript/es6/api.mustache | 2 +- .../resources/Javascript/es6/model.mustache | 7 +- .../es6/partial_model_enum_class.mustache | 2 +- .../es6/partial_model_generic.mustache | 161 ++++--- .../es6/partial_model_inner_enum.mustache | 28 +- pom.xml | 39 ++ .../client/petstore/javascript-es6/pom.xml | 45 ++ .../petstore/javascript-es6/src/ApiClient.js | 77 ++-- .../javascript-es6/src/api/FakeApi.js | 6 +- .../src/api/Fake_classname_tags123Api.js | 82 ---- .../javascript-es6/src/api/StoreApi.js | 2 +- .../javascript-es6/src/api/UserApi.js | 2 +- .../src/model/AdditionalPropertiesClass.js | 88 ++-- .../javascript-es6/src/model/Animal.js | 93 ++--- .../javascript-es6/src/model/AnimalFarm.js | 70 ++-- .../javascript-es6/src/model/ApiResponse.js | 97 ++--- .../src/model/ArrayOfArrayOfNumberOnly.js | 79 ++-- .../src/model/ArrayOfNumberOnly.js | 79 ++-- .../javascript-es6/src/model/ArrayTest.js | 97 ++--- .../src/model/Capitalization.js | 126 +++--- .../petstore/javascript-es6/src/model/Cat.js | 107 +++-- .../javascript-es6/src/model/Category.js | 88 ++-- .../javascript-es6/src/model/ClassModel.js | 81 ++-- .../javascript-es6/src/model/Client.js | 79 ++-- .../petstore/javascript-es6/src/model/Dog.js | 107 +++-- .../javascript-es6/src/model/EnumArrays.js | 170 ++++---- .../javascript-es6/src/model/EnumClass.js | 10 +- .../javascript-es6/src/model/EnumTest.js | 306 +++++++------- .../javascript-es6/src/model/FormatTest.js | 199 ++++----- .../src/model/HasOnlyReadOnly.js | 88 ++-- .../petstore/javascript-es6/src/model/List.js | 79 ++-- .../javascript-es6/src/model/MapTest.js | 129 +++--- ...dPropertiesAndAdditionalPropertiesClass.js | 97 ++--- .../src/model/Model200Response.js | 90 ++-- .../javascript-es6/src/model/ModelReturn.js | 81 ++-- .../petstore/javascript-es6/src/model/Name.js | 111 +++-- .../javascript-es6/src/model/NumberOnly.js | 79 ++-- .../javascript-es6/src/model/Order.js | 181 ++++---- .../javascript-es6/src/model/OuterBoolean.js | 73 ---- .../src/model/OuterComposite.js | 97 ++--- .../javascript-es6/src/model/OuterEnum.js | 10 +- .../javascript-es6/src/model/OuterNumber.js | 73 ---- .../javascript-es6/src/model/OuterString.js | 73 ---- .../petstore/javascript-es6/src/model/Pet.js | 185 ++++----- .../javascript-es6/src/model/ReadOnlyFirst.js | 88 ++-- .../src/model/SpecialModelName.js | 79 ++-- .../petstore/javascript-es6/src/model/Tag.js | 88 ++-- .../petstore/javascript-es6/src/model/User.js | 144 ++++--- .../javascript-es6/src/test/ApiClientTest.js | 393 ++++++++++++++++++ .../src/test/api/AnotherFakeApi.spec.js | 63 +++ .../src/test/api/FakeApi.spec.js | 123 ++++++ .../test/api/FakeClassnameTags123Api.spec.js | 63 +++ .../src/test/api/PetApi.spec.js | 133 ++++++ .../src/test/api/StoreApi.spec.js | 93 +++++ .../src/test/api/UserApi.spec.js | 133 ++++++ .../model/AdditionalPropertiesClass.spec.js | 71 ++++ .../src/test/model/Animal.spec.js | 71 ++++ .../src/test/model/AnimalFarm.spec.js | 59 +++ .../src/test/model/ApiResponse.spec.js | 77 ++++ .../model/ArrayOfArrayOfNumberOnly.spec.js | 65 +++ .../src/test/model/ArrayOfNumberOnly.spec.js | 65 +++ .../src/test/model/ArrayTest.spec.js | 77 ++++ .../src/test/model/Capitalization.spec.js | 95 +++++ .../javascript-es6/src/test/model/Cat.spec.js | 65 +++ .../src/test/model/Category.spec.js | 71 ++++ .../src/test/model/ClassModel.spec.js | 65 +++ .../src/test/model/Client.spec.js | 65 +++ .../javascript-es6/src/test/model/Dog.spec.js | 65 +++ .../src/test/model/EnumArrays.spec.js | 71 ++++ .../src/test/model/EnumClass.spec.js | 58 +++ .../src/test/model/EnumTest.spec.js | 83 ++++ .../src/test/model/FormatTest.spec.js | 137 ++++++ .../src/test/model/HasOnlyReadOnly.spec.js | 71 ++++ .../src/test/model/List.spec.js | 65 +++ .../src/test/model/MapTest.spec.js | 71 ++++ ...ertiesAndAdditionalPropertiesClass.spec.js | 77 ++++ .../src/test/model/Model200Response.spec.js | 71 ++++ .../src/test/model/ModelReturn.spec.js | 65 +++ .../src/test/model/Name.spec.js | 83 ++++ .../src/test/model/NumberOnly.spec.js | 65 +++ .../src/test/model/Order.spec.js | 95 +++++ .../src/test/model/OuterBoolean.spec.js | 60 +++ .../src/test/model/OuterComposite.spec.js | 77 ++++ .../src/test/model/OuterEnum.spec.js | 58 +++ .../src/test/model/OuterNumber.spec.js | 60 +++ .../src/test/model/OuterString.spec.js | 60 +++ .../javascript-es6/src/test/model/Pet.spec.js | 95 +++++ .../src/test/model/ReadOnlyFirst.spec.js | 71 ++++ .../src/test/model/SpecialModelName.spec.js | 65 +++ .../javascript-es6/src/test/model/Tag.spec.js | 71 ++++ .../src/test/model/User.spec.js | 107 +++++ .../javascript-es6/test/ApiClientTest.js | 393 ++++++++++++++++++ .../test/api/AnotherFakeApi.spec.js | 14 +- .../javascript-es6/test/api/FakeApi.spec.js | 44 +- .../test/api/FakeClassnameTags123Api.spec.js | 14 +- .../javascript-es6/test/api/PetApi.spec.js | 14 +- .../javascript-es6/test/api/StoreApi.spec.js | 14 +- .../javascript-es6/test/api/UserApi.spec.js | 14 +- .../model/AdditionalPropertiesClass.spec.js | 22 +- .../javascript-es6/test/model/Animal.spec.js | 22 +- .../test/model/AnimalFarm.spec.js | 18 +- .../test/model/ApiResponse.spec.js | 24 +- .../model/ArrayOfArrayOfNumberOnly.spec.js | 20 +- .../test/model/ArrayOfNumberOnly.spec.js | 20 +- .../test/model/ArrayTest.spec.js | 24 +- .../test/model/Capitalization.spec.js | 30 +- .../javascript-es6/test/model/Cat.spec.js | 20 +- .../test/model/Category.spec.js | 22 +- .../test/model/ClassModel.spec.js | 20 +- .../javascript-es6/test/model/Client.spec.js | 20 +- .../javascript-es6/test/model/Dog.spec.js | 20 +- .../test/model/EnumArrays.spec.js | 22 +- .../test/model/EnumClass.spec.js | 16 +- .../test/model/EnumTest.spec.js | 32 +- .../test/model/FormatTest.spec.js | 44 +- .../test/model/HasOnlyReadOnly.spec.js | 22 +- .../javascript-es6/test/model/List.spec.js | 24 +- .../javascript-es6/test/model/MapTest.spec.js | 22 +- ...ertiesAndAdditionalPropertiesClass.spec.js | 24 +- .../test/model/Model200Response.spec.js | 22 +- .../test/model/ModelReturn.spec.js | 20 +- .../javascript-es6/test/model/Name.spec.js | 30 +- .../test/model/NumberOnly.spec.js | 20 +- .../javascript-es6/test/model/Order.spec.js | 30 +- .../test/model/OuterBoolean.spec.js | 3 +- .../test/model/OuterComposite.spec.js | 24 +- .../test/model/OuterEnum.spec.js | 16 +- .../test/model/OuterNumber.spec.js | 3 +- .../test/model/OuterString.spec.js | 3 +- .../javascript-es6/test/model/Pet.spec.js | 30 +- .../test/model/ReadOnlyFirst.spec.js | 22 +- .../test/model/SpecialModelName.spec.js | 20 +- .../javascript-es6/test/model/Tag.spec.js | 22 +- .../javascript-es6/test/model/User.spec.js | 34 +- .../petstore/javascript-promise-es6/pom.xml | 6 +- .../javascript-promise-es6/src/ApiClient.js | 77 ++-- .../javascript-promise-es6/src/api/FakeApi.js | 6 +- .../src/api/Fake_classname_tags123Api.js | 86 ---- .../src/api/StoreApi.js | 2 +- .../javascript-promise-es6/src/api/UserApi.js | 2 +- .../src/model/AdditionalPropertiesClass.js | 88 ++-- .../src/model/Animal.js | 93 ++--- .../src/model/AnimalFarm.js | 70 ++-- .../src/model/ApiResponse.js | 97 ++--- .../src/model/ArrayOfArrayOfNumberOnly.js | 79 ++-- .../src/model/ArrayOfNumberOnly.js | 79 ++-- .../src/model/ArrayTest.js | 97 ++--- .../src/model/Capitalization.js | 126 +++--- .../javascript-promise-es6/src/model/Cat.js | 107 +++-- .../src/model/Category.js | 88 ++-- .../src/model/ClassModel.js | 81 ++-- .../src/model/Client.js | 79 ++-- .../javascript-promise-es6/src/model/Dog.js | 107 +++-- .../src/model/EnumArrays.js | 170 ++++---- .../src/model/EnumClass.js | 10 +- .../src/model/EnumTest.js | 306 +++++++------- .../src/model/FormatTest.js | 199 ++++----- .../src/model/HasOnlyReadOnly.js | 88 ++-- .../javascript-promise-es6/src/model/List.js | 79 ++-- .../src/model/MapTest.js | 129 +++--- ...dPropertiesAndAdditionalPropertiesClass.js | 97 ++--- .../src/model/Model200Response.js | 90 ++-- .../src/model/ModelReturn.js | 81 ++-- .../javascript-promise-es6/src/model/Name.js | 111 +++-- .../src/model/NumberOnly.js | 79 ++-- .../javascript-promise-es6/src/model/Order.js | 181 ++++---- .../src/model/OuterBoolean.js | 73 ---- .../src/model/OuterComposite.js | 97 ++--- .../src/model/OuterEnum.js | 10 +- .../src/model/OuterNumber.js | 73 ---- .../src/model/OuterString.js | 73 ---- .../javascript-promise-es6/src/model/Pet.js | 185 ++++----- .../src/model/ReadOnlyFirst.js | 88 ++-- .../src/model/SpecialModelName.js | 79 ++-- .../javascript-promise-es6/src/model/Tag.js | 88 ++-- .../javascript-promise-es6/src/model/User.js | 144 ++++--- .../test/ApiClientTest.js | 393 ++++++++++++++++++ .../test/model/OuterBoolean.spec.js | 3 +- .../test/model/OuterNumber.spec.js | 3 +- .../test/model/OuterString.spec.js | 3 +- .../petstore/javascript-promise/pom.xml | 6 +- .../javascript-promise/src/api/FakeApi.js | 6 +- .../javascript-promise/src/api/StoreApi.js | 2 +- .../javascript-promise/src/api/UserApi.js | 2 +- .../javascript-promise/test/ApiClientTest.js | 3 +- .../test/model/OuterBoolean.spec.js | 3 +- .../test/model/OuterNumber.spec.js | 3 +- .../test/model/OuterString.spec.js | 3 +- .../petstore/javascript/src/api/FakeApi.js | 6 +- .../petstore/javascript/src/api/StoreApi.js | 2 +- .../petstore/javascript/src/api/UserApi.js | 2 +- 194 files changed, 8532 insertions(+), 5008 deletions(-) create mode 100644 samples/client/petstore/javascript-es6/pom.xml delete mode 100644 samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js delete mode 100644 samples/client/petstore/javascript-es6/src/model/OuterBoolean.js delete mode 100644 samples/client/petstore/javascript-es6/src/model/OuterNumber.js delete mode 100644 samples/client/petstore/javascript-es6/src/model/OuterString.js create mode 100644 samples/client/petstore/javascript-es6/src/test/ApiClientTest.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/AnotherFakeApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/FakeApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/FakeClassnameTags123Api.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/PetApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/StoreApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/UserApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/AdditionalPropertiesClass.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Animal.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/AnimalFarm.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ApiResponse.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ArrayOfArrayOfNumberOnly.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ArrayOfNumberOnly.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ArrayTest.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Capitalization.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Cat.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Category.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ClassModel.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Client.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Dog.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/EnumArrays.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/EnumClass.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/EnumTest.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/FormatTest.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/HasOnlyReadOnly.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/List.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/MapTest.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Model200Response.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ModelReturn.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Name.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/NumberOnly.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Order.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterBoolean.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterComposite.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterEnum.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterNumber.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterString.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Pet.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ReadOnlyFirst.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/SpecialModelName.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Tag.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/User.spec.js create mode 100644 samples/client/petstore/javascript-es6/test/ApiClientTest.js delete mode 100644 samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js delete mode 100644 samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js delete mode 100644 samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js delete mode 100644 samples/client/petstore/javascript-promise-es6/src/model/OuterString.js create mode 100644 samples/client/petstore/javascript-promise-es6/test/ApiClientTest.js diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index 75b07b266ff..198a9bff546 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -986,6 +986,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo } String jsdocType = getJSDocType(operation); operation.vendorExtensions.put("x-jsdoc-type", jsdocType); + + // Format the return type correctly + if (operation.returnType != null) { + operation.vendorExtensions.put("x-return-type", normalizeType(operation.returnType)); + } } } return objs; diff --git a/modules/openapi-generator/src/main/resources/Javascript/api.mustache b/modules/openapi-generator/src/main/resources/Javascript/api.mustache index fedb65f421b..089ae3b3283 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/api.mustache @@ -84,7 +84,7 @@ var authNames = [<#authMethods>''<#hasMore>, ]; var contentTypes = [<#consumes>'<& mediaType>'<#hasMore>, ]; var accepts = [<#produces>'<& mediaType>'<#hasMore>, ]; - var returnType = <#returnType><&returnType><^returnType>null; + var returnType = <#vendorExtensions.x-return-type><&vendorExtensions.x-return-type><^vendorExtensions.x-return-type>null; return this.apiClient.callApi( '<&path>', '', diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache index c3caec29101..7ba837e183d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache @@ -15,7 +15,7 @@ import querystring from "querystring"; * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient * @class */{{/emitJSDoc}} -export default class ApiClient { +class ApiClient { constructor() { {{#emitJSDoc}}/** * The base URL against which to resolve every API call's (relative) path. @@ -221,43 +221,6 @@ export default class ApiClient { return newParams; } - {{#emitJSDoc}}/** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */{{/emitJSDoc}} - static CollectionFormatEnum = { - {{#emitJSDoc}}/** - * Comma-separated values. Value: csv - * @const - */{{/emitJSDoc}} - CSV: ',', - - {{#emitJSDoc}}/** - * Space-separated values. Value: ssv - * @const - */{{/emitJSDoc}} - SSV: ' ', - - {{#emitJSDoc}}/** - * Tab-separated values. Value: tsv - * @const - */{{/emitJSDoc}} - TSV: '\t', - - {{#emitJSDoc}}/** - * Pipe(|)-separated values. Value: pipes - * @const - */{{/emitJSDoc}} - PIPES: '|', - - {{#emitJSDoc}}/** - * Native array. Value: multi - * @const - */{{/emitJSDoc}} - MULTI: 'multi' - }; - {{#emitJSDoc}}/** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. @@ -597,8 +560,46 @@ export default class ApiClient { }; } +{{#emitJSDoc}}/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */{{/emitJSDoc}} +ApiClient.CollectionFormatEnum = { + {{#emitJSDoc}}/** + * Comma-separated values. Value: csv + * @const + */{{/emitJSDoc}} + CSV: ',', + + {{#emitJSDoc}}/** + * Space-separated values. Value: ssv + * @const + */{{/emitJSDoc}} + SSV: ' ', + + {{#emitJSDoc}}/** + * Tab-separated values. Value: tsv + * @const + */{{/emitJSDoc}} + TSV: '\t', + + {{#emitJSDoc}}/** + * Pipe(|)-separated values. Value: pipes + * @const + */{{/emitJSDoc}} + PIPES: '|', + + {{#emitJSDoc}}/** + * Native array. Value: multi + * @const + */{{/emitJSDoc}} + MULTI: 'multi' +}; + {{#emitJSDoc}}/** * The default API client implementation. * @type {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient} */{{/emitJSDoc}} ApiClient.instance = new ApiClient(); +export default ApiClient; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache index 0615a0461d4..a6b7b0379cf 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache @@ -69,7 +69,7 @@ export default class { let authNames = [<#authMethods>''<#hasMore>, ]; let contentTypes = [<#consumes>'<& mediaType>'<#hasMore>, ]; let accepts = [<#produces>'<& mediaType>'<#hasMore>, ]; - let returnType = <#returnType><&returnType><^returnType>null; + let returnType = <#vendorExtensions.x-return-type><&vendorExtensions.x-return-type><^vendorExtensions.x-return-type>null; return this.apiClient.callApi( '<&path>', '', diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/model.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/model.mustache index d45b6e9b673..3ddf83730f5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/model.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/model.mustache @@ -1,9 +1,4 @@ {{>licenseInfo}} - import ApiClient from '../ApiClient'; {{#imports}}import {{import}} from './{{import}}'; -{{/imports}} - -{{#models}}{{#model}} -{{#isEnum}}{{>partial_model_enum_class}}{{/isEnum}}{{^isEnum}}{{>partial_model_generic}}{{/isEnum}} -{{/model}}{{/models}} +{{/imports}}{{#models}}{{#model}}{{#isEnum}}{{>partial_model_enum_class}}{{/isEnum}}{{^isEnum}}{{>partial_model_generic}}{{/isEnum}}{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_enum_class.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_enum_class.mustache index 5503ab886af..e88ddd9cfb5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_enum_class.mustache @@ -9,7 +9,7 @@ export default class {{classname}} { * value: {{{value}}} * @const */{{/emitJSDoc}} - {{name}} = {{{value}}}; + "{{name}}" = {{{value}}}; {{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache index bcfb59dbfdb..3b60625bd80 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache @@ -1,54 +1,49 @@ -{{#models}}{{#model}} - -{{#emitJSDoc}}/** -* The {{classname}} model module. -* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} -* @version {{projectVersion}} -*/{{/emitJSDoc}} -export default class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}extends Array {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{ +{{#models}}{{#model}}{{#emitJSDoc}}/** + * The {{classname}} model module. + * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @version {{projectVersion}} + */{{/emitJSDoc}} +class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}extends Array {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{ {{#emitJSDoc}}/** - * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} - * @class{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} - */{{/emitJSDoc}} - - constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { - {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}} + * Constructs a new {{classname}}.{{#description}} + * {{description}}{{/description}} + * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} + */{{/emitJSDoc}} + constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}} super(); - {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}} - - {{#useInheritance}} - {{#parentModel}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/parentModel}} - {{#interfaceModels}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/interfaceModels}} - {{/useInheritance}} - - {{#vars}}{{#required}}this['{{baseName}}'] = {{name}};{{/required}}{{/vars}} - - {{#parent}}{{^parentModel}}return this;{{/parentModel}}{{/parent}} + {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{{#useInheritance}} + {{#interfaceModels}}{{classname}}.initialize(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/interfaceModels}}{{/useInheritance}} + {{classname}}.initialize(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}}); } {{#emitJSDoc}}/** - * Constructs a {{classname}} from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> obj Optional instance to populate. - * @return {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> The populated {{classname}} instance. - */{{/emitJSDoc}} + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */{{/emitJSDoc}} + static initialize(obj{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}}) { {{#vars}}{{#required}} + obj['{{baseName}}'] = {{name}};{{/required}}{{/vars}} + } + + {{#emitJSDoc}}/** + * Constructs a {{classname}} from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> obj Optional instance to populate. + * @return {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> The populated {{classname}} instance. + */{{/emitJSDoc}} static constructFromObject(data, obj) { if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} { - obj = obj || new {{classname}}(); + obj = obj || new {{classname}}();{{#parent}}{{^parentModel}} - {{#parent}}{{^parentModel}}ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}');{{/parentModel}} - {{/parent}} - - {{#useInheritance}}{{#parentModel}}{{classname}}.constructFromObject(data, obj);{{/parentModel}} - {{#interfaces}}{{.}}.constructFromObject(data, obj);{{/interfaces}} - {{/useInheritance}} + ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}'); + {{/parentModel}}{{/parent}}{{#useInheritance}}{{#parentModel}} + {{classname}}.constructFromObject(data, obj);{{/parentModel}}{{#interfaces}} + {{.}}.constructFromObject(data, obj);{{/interfaces}}{{/useInheritance}} {{#vars}} if (data.hasOwnProperty('{{baseName}}')) { @@ -59,61 +54,49 @@ export default class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtension return obj; } -{{#vars}} - {{#emitJSDoc}}/**{{#description}} - * {{{description}}}{{/description}} - * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} - */{{/emitJSDoc}} - {{baseName}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; -{{/vars}} - -{{#useInheritance}}{{#interfaceModels}} - // Implement {{classname}} interface: - {{#allVars}}{{#emitJSDoc}}/**{{#description}} - * {{{description}}}{{/description}} - * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} - */{{/emitJSDoc}} - {{baseName}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; - {{/allVars}} -{{/interfaceModels}}{{/useInheritance}} - - -{{#emitModelMethods}}{{#vars}} - {{#emitJSDoc}}/**{{#description}} - * Returns {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} - * @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> - */{{/emitJSDoc}} +{{#emitModelMethods}}{{#vars}}{{#emitJSDoc}}/**{{#description}} + * Returns {{{description}}}{{/description}}{{#minimum}} + * minimum: {{minimum}}{{/minimum}}{{#maximum}} + * maximum: {{maximum}}{{/maximum}} + * @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> + */{{/emitJSDoc}} {{getter}}() { return this.{{baseName}}; } {{#emitJSDoc}}/**{{#description}} - * Sets {{{description}}}{{/description}} - * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}} - */{{/emitJSDoc}} + * Sets {{{description}}}{{/description}} + * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}} + */{{/emitJSDoc}} {{setter}}({{name}}) { this['{{baseName}}'] = {{name}}; } -{{/vars}}{{/emitModelMethods}} +{{/vars}}{{/emitModelMethods}}{{/model}} +} + +{{#vars}}{{#emitJSDoc}}/**{{#description}} + * {{{description}}}{{/description}} + * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} + * @default {{{defaultValue}}}{{/defaultValue}} + */{{/emitJSDoc}} +{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; -{{#vars}} -{{#isEnum}} -{{^isContainer}} -{{>partial_model_inner_enum}} -{{/isContainer}} -{{/isEnum}} -{{#items.isEnum}} -{{#items}} -{{^isContainer}} -{{>partial_model_inner_enum}} -{{/isContainer}} -{{/items}} -{{/items.isEnum}} {{/vars}} -{{/model}}{{/models}} -} +{{#useInheritance}}{{#interfaceModels}}// Implement {{classname}} interface: +{{#allVars}}{{#emitJSDoc}}/**{{#description}} + * {{{description}}}{{/description}} + * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} + * @default {{{defaultValue}}}{{/defaultValue}} + */{{/emitJSDoc}} +{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +{{/allVars}}{{/interfaceModels}}{{/useInheritance}} + +{{#vars}}{{#isEnum}}{{^isContainer}} +{{>partial_model_inner_enum}} +{{/isContainer}}{{/isEnum}}{{#items.isEnum}}{{#items}}{{^isContainer}} +{{>partial_model_inner_enum}} +{{/isContainer}}{{/items}}{{/items.isEnum}}{{/vars}} + +export default {{classname}}; +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache index 521e497ba0c..17cea4407d5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache @@ -1,15 +1,15 @@ +{{#emitJSDoc}}/** + * Allowed values for the {{baseName}} property. + * @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%> + * @readonly + */{{/emitJSDoc}} +{{classname}}['{{datatypeWithEnum}}'] = { +{{#allowableValues}}{{#enumVars}} {{#emitJSDoc}}/** - * Allowed values for the {{baseName}} property. - * @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%> - * @readonly - */{{/emitJSDoc}} - static {{datatypeWithEnum}} = { - {{#allowableValues}}{{#enumVars}} - {{#emitJSDoc}}/** - * value: {{{value}}} - * @const - */{{/emitJSDoc}} - "{{name}}": {{{value}}}{{^-last}}, - {{/-last}} - {{/enumVars}}{{/allowableValues}} - }; + * value: {{{value}}} + * @const + */{{/emitJSDoc}} + "{{name}}": {{{value}}}{{^-last}}, + {{/-last}} +{{/enumVars}}{{/allowableValues}} +}; diff --git a/pom.xml b/pom.xml index 24acb59feb5..e52007824c9 100644 --- a/pom.xml +++ b/pom.xml @@ -571,6 +571,42 @@ samples/client/petstore/javascript + + javascript-client-es6 + + + env + javascript + + + + samples/client/petstore/javascript-es6 + + + + javascript-client-promise + + + env + javascript + + + + samples/client/petstore/javascript-promise + + + + javascript-client-promise-es6 + + + env + javascript + + + + samples/client/petstore/javascript-promise-es6 + + scala-client @@ -904,6 +940,9 @@ samples/client/petstore/scala samples/client/petstore/akka-scala samples/client/petstore/javascript + samples/client/petstore/javascript-es6 + samples/client/petstore/javascript-promise + samples/client/petstore/javascript-promise-es6 samples/client/petstore/python samples/client/petstore/python-tornado samples/client/petstore/python-asyncio diff --git a/samples/client/petstore/javascript-es6/pom.xml b/samples/client/petstore/javascript-es6/pom.xml new file mode 100644 index 00000000000..66f75f962f9 --- /dev/null +++ b/samples/client/petstore/javascript-es6/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + org.openapitools + openapi-petstore-javascript-es6 + pom + 1.0-SNAPSHOT + OpenAPI Petstore JS Client (ES6) + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + mocha + integration-test + + exec + + + npm + + test + + + + + + + + diff --git a/samples/client/petstore/javascript-es6/src/ApiClient.js b/samples/client/petstore/javascript-es6/src/ApiClient.js index 50a32ae9d6e..85db2a42984 100644 --- a/samples/client/petstore/javascript-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-es6/src/ApiClient.js @@ -27,7 +27,7 @@ import querystring from "querystring"; * @alias module:ApiClient * @class */ -export default class ApiClient { +class ApiClient { constructor() { /** * The base URL against which to resolve every API call's (relative) path. @@ -225,43 +225,6 @@ export default class ApiClient { return newParams; } - /** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */ - static CollectionFormatEnum = { - /** - * Comma-separated values. Value: csv - * @const - */ - CSV: ',', - - /** - * Space-separated values. Value: ssv - * @const - */ - SSV: ' ', - - /** - * Tab-separated values. Value: tsv - * @const - */ - TSV: '\t', - - /** - * Pipe(|)-separated values. Value: pipes - * @const - */ - PIPES: '|', - - /** - * Native array. Value: multi - * @const - */ - MULTI: 'multi' - }; - /** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. @@ -581,8 +544,46 @@ export default class ApiClient { }; } +/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ +ApiClient.CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' +}; + /** * The default API client implementation. * @type {module:ApiClient} */ ApiClient.instance = new ApiClient(); +export default ApiClient; \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index a05dd72606c..725872e0996 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -68,7 +68,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = Boolean; + let returnType = 'Boolean'; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', @@ -150,7 +150,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = Number; + let returnType = 'Number'; return this.apiClient.callApi( '/fake/outer/number', 'POST', @@ -191,7 +191,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = String; + let returnType = 'String'; return this.apiClient.callApi( '/fake/outer/string', 'POST', diff --git a/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js b/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js deleted file mode 100644 index 1240fbf42c1..00000000000 --- a/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from "../ApiClient"; -import Client from '../model/Client'; - -/** -* Fake_classname_tags123 service. -* @module api/Fake_classname_tags123Api -* @version 1.0.0 -*/ -export default class Fake_classname_tags123Api { - - /** - * Constructs a new Fake_classname_tags123Api. - * @alias module:api/Fake_classname_tags123Api - * @class - * @param {module:ApiClient} [apiClient] Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - constructor(apiClient) { - this.apiClient = apiClient || ApiClient.instance; - } - - - /** - * Callback function to receive the result of the testClassname operation. - * @callback module:api/Fake_classname_tags123Api~testClassnameCallback - * @param {String} error Error message, if any. - * @param {module:model/Client} data The data returned by the service call. - * @param {String} response The complete HTTP response. - */ - - /** - * To test class name in snake case - * @param {module:model/Client} body client model - * @param {module:api/Fake_classname_tags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response - * data is of type: {@link module:model/Client} - */ - testClassname(body, callback) { - let postBody = body; - - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling testClassname"); - } - - - let pathParams = { - }; - let queryParams = { - }; - let headerParams = { - }; - let formParams = { - }; - - let authNames = ['api_key_query']; - let contentTypes = ['application/json']; - let accepts = ['application/json']; - let returnType = Client; - - return this.apiClient.callApi( - '/fake_classname_test', 'PATCH', - pathParams, queryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback - ); - } - - -} diff --git a/samples/client/petstore/javascript-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-es6/src/api/StoreApi.js index 33029258885..9c719f5ad22 100644 --- a/samples/client/petstore/javascript-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-es6/src/api/StoreApi.js @@ -109,7 +109,7 @@ export default class StoreApi { let authNames = ['api_key']; let contentTypes = []; let accepts = ['application/json']; - let returnType = {String: Number}; + let returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', diff --git a/samples/client/petstore/javascript-es6/src/api/UserApi.js b/samples/client/petstore/javascript-es6/src/api/UserApi.js index 314e8db8f99..c3e574b9588 100644 --- a/samples/client/petstore/javascript-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-es6/src/api/UserApi.js @@ -297,7 +297,7 @@ export default class UserApi { let authNames = []; let contentTypes = []; let accepts = ['application/xml', 'application/json']; - let returnType = String; + let returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', diff --git a/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js index 227fb797557..d6e898a5ab0 100644 --- a/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The AdditionalPropertiesClass model module. -* @module model/AdditionalPropertiesClass -* @version 1.0.0 -*/ -export default class AdditionalPropertiesClass { + * The AdditionalPropertiesClass model module. + * @module model/AdditionalPropertiesClass + * @version 1.0.0 + */ +class AdditionalPropertiesClass { /** - * Constructs a new AdditionalPropertiesClass. - * @alias module:model/AdditionalPropertiesClass - * @class - */ - - constructor() { - - - - - - - + * Constructs a new AdditionalPropertiesClass. + * @alias module:model/AdditionalPropertiesClass + */ + constructor() { + AdditionalPropertiesClass.initialize(this); } /** - * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. - * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new AdditionalPropertiesClass(); - - - - if (data.hasOwnProperty('map_property')) { obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'}); } @@ -66,22 +57,23 @@ export default class AdditionalPropertiesClass { return obj; } - /** - * @member {Object.} map_property - */ - map_property = undefined; - /** - * @member {Object.>} map_of_map_property - */ - map_of_map_property = undefined; - - - - - - - } +/** + * @member {Object.} map_property + */ +AdditionalPropertiesClass.prototype['map_property'] = undefined; + +/** + * @member {Object.>} map_of_map_property + */ +AdditionalPropertiesClass.prototype['map_of_map_property'] = undefined; + + + + + + +export default AdditionalPropertiesClass; diff --git a/samples/client/petstore/javascript-es6/src/model/Animal.js b/samples/client/petstore/javascript-es6/src/model/Animal.js index dce658d7016..c55d0c758f0 100644 --- a/samples/client/petstore/javascript-es6/src/model/Animal.js +++ b/samples/client/petstore/javascript-es6/src/model/Animal.js @@ -11,52 +11,44 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Animal model module. -* @module model/Animal -* @version 1.0.0 -*/ -export default class Animal { + * The Animal model module. + * @module model/Animal + * @version 1.0.0 + */ +class Animal { /** - * Constructs a new Animal. - * @alias module:model/Animal - * @class - * @param className {String} - */ - - constructor(className) { - - - - - - this['className'] = className; - + * Constructs a new Animal. + * @alias module:model/Animal + * @param className {String} + */ + constructor(className) { + Animal.initialize(this, className); } /** - * Constructs a Animal from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Animal} obj Optional instance to populate. - * @return {module:model/Animal} The populated Animal instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + obj['className'] = className; + } + + /** + * Constructs a Animal from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Animal} obj Optional instance to populate. + * @return {module:model/Animal} The populated Animal instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Animal(); - - - - if (data.hasOwnProperty('className')) { obj['className'] = ApiClient.convertToType(data['className'], 'String'); } @@ -67,23 +59,24 @@ export default class Animal { return obj; } - /** - * @member {String} className - */ - className = undefined; - /** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - - } +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; + +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + + + +export default Animal; diff --git a/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js b/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js index c0663cd1fa6..3b9cc01f03d 100644 --- a/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js @@ -11,54 +11,47 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The AnimalFarm model module. -* @module model/AnimalFarm -* @version 1.0.0 -*/ -export default class AnimalFarm extends Array { + * The AnimalFarm model module. + * @module model/AnimalFarm + * @version 1.0.0 + */ +class AnimalFarm extends Array { /** - * Constructs a new AnimalFarm. - * @alias module:model/AnimalFarm - * @class - * @extends Array - */ - - constructor() { - + * Constructs a new AnimalFarm. + * @alias module:model/AnimalFarm + * @extends Array + */ + constructor() { super(); - - - - - - return this; + AnimalFarm.initialize(this); } /** - * Constructs a AnimalFarm from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/AnimalFarm} obj Optional instance to populate. - * @return {module:model/AnimalFarm} The populated AnimalFarm instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AnimalFarm from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AnimalFarm} obj Optional instance to populate. + * @return {module:model/AnimalFarm} The populated AnimalFarm instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new AnimalFarm(); ApiClient.constructFromObject(data, obj, 'Animal'); - - } @@ -66,13 +59,12 @@ export default class AnimalFarm extends Array { } - - - - - - - } + + + + +export default AnimalFarm; + diff --git a/samples/client/petstore/javascript-es6/src/model/ApiResponse.js b/samples/client/petstore/javascript-es6/src/model/ApiResponse.js index 48142ded09d..4f5fb55291c 100644 --- a/samples/client/petstore/javascript-es6/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-es6/src/model/ApiResponse.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ApiResponse model module. -* @module model/ApiResponse -* @version 1.0.0 -*/ -export default class ApiResponse { + * The ApiResponse model module. + * @module model/ApiResponse + * @version 1.0.0 + */ +class ApiResponse { /** - * Constructs a new ApiResponse. - * @alias module:model/ApiResponse - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ApiResponse. + * @alias module:model/ApiResponse + */ + constructor() { + ApiResponse.initialize(this); } /** - * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ApiResponse} obj Optional instance to populate. - * @return {module:model/ApiResponse} The populated ApiResponse instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ApiResponse} obj Optional instance to populate. + * @return {module:model/ApiResponse} The populated ApiResponse instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ApiResponse(); - - - - if (data.hasOwnProperty('code')) { obj['code'] = ApiClient.convertToType(data['code'], 'Number'); } @@ -69,26 +60,28 @@ export default class ApiResponse { return obj; } - /** - * @member {Number} code - */ - code = undefined; - /** - * @member {String} type - */ - type = undefined; - /** - * @member {String} message - */ - message = undefined; - - - - - - - } +/** + * @member {Number} code + */ +ApiResponse.prototype['code'] = undefined; + +/** + * @member {String} type + */ +ApiResponse.prototype['type'] = undefined; + +/** + * @member {String} message + */ +ApiResponse.prototype['message'] = undefined; + + + + + + +export default ApiResponse; diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js index acfac49ce0d..e8d959f3689 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ArrayOfArrayOfNumberOnly model module. -* @module model/ArrayOfArrayOfNumberOnly -* @version 1.0.0 -*/ -export default class ArrayOfArrayOfNumberOnly { + * The ArrayOfArrayOfNumberOnly model module. + * @module model/ArrayOfArrayOfNumberOnly + * @version 1.0.0 + */ +class ArrayOfArrayOfNumberOnly { /** - * Constructs a new ArrayOfArrayOfNumberOnly. - * @alias module:model/ArrayOfArrayOfNumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayOfArrayOfNumberOnly. + * @alias module:model/ArrayOfArrayOfNumberOnly + */ + constructor() { + ArrayOfArrayOfNumberOnly.initialize(this); } /** - * Constructs a ArrayOfArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayOfArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayOfArrayOfNumberOnly(); - - - - if (data.hasOwnProperty('ArrayArrayNumber')) { obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]); } @@ -63,18 +54,18 @@ export default class ArrayOfArrayOfNumberOnly { return obj; } - /** - * @member {Array.>} ArrayArrayNumber - */ - ArrayArrayNumber = undefined; - - - - - - - } +/** + * @member {Array.>} ArrayArrayNumber + */ +ArrayOfArrayOfNumberOnly.prototype['ArrayArrayNumber'] = undefined; + + + + + + +export default ArrayOfArrayOfNumberOnly; diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js index 28a47d0bb7a..4fb72e435e6 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ArrayOfNumberOnly model module. -* @module model/ArrayOfNumberOnly -* @version 1.0.0 -*/ -export default class ArrayOfNumberOnly { + * The ArrayOfNumberOnly model module. + * @module model/ArrayOfNumberOnly + * @version 1.0.0 + */ +class ArrayOfNumberOnly { /** - * Constructs a new ArrayOfNumberOnly. - * @alias module:model/ArrayOfNumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayOfNumberOnly. + * @alias module:model/ArrayOfNumberOnly + */ + constructor() { + ArrayOfNumberOnly.initialize(this); } /** - * Constructs a ArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayOfNumberOnly(); - - - - if (data.hasOwnProperty('ArrayNumber')) { obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']); } @@ -63,18 +54,18 @@ export default class ArrayOfNumberOnly { return obj; } - /** - * @member {Array.} ArrayNumber - */ - ArrayNumber = undefined; - - - - - - - } +/** + * @member {Array.} ArrayNumber + */ +ArrayOfNumberOnly.prototype['ArrayNumber'] = undefined; + + + + + + +export default ArrayOfNumberOnly; diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayTest.js b/samples/client/petstore/javascript-es6/src/model/ArrayTest.js index eff8b23dd82..8096c2c4f7f 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayTest.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; import ReadOnlyFirst from './ReadOnlyFirst'; - - - - /** -* The ArrayTest model module. -* @module model/ArrayTest -* @version 1.0.0 -*/ -export default class ArrayTest { + * The ArrayTest model module. + * @module model/ArrayTest + * @version 1.0.0 + */ +class ArrayTest { /** - * Constructs a new ArrayTest. - * @alias module:model/ArrayTest - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayTest. + * @alias module:model/ArrayTest + */ + constructor() { + ArrayTest.initialize(this); } /** - * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayTest} obj Optional instance to populate. - * @return {module:model/ArrayTest} The populated ArrayTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayTest} obj Optional instance to populate. + * @return {module:model/ArrayTest} The populated ArrayTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayTest(); - - - - if (data.hasOwnProperty('array_of_string')) { obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']); } @@ -70,26 +61,28 @@ export default class ArrayTest { return obj; } - /** - * @member {Array.} array_of_string - */ - array_of_string = undefined; - /** - * @member {Array.>} array_array_of_integer - */ - array_array_of_integer = undefined; - /** - * @member {Array.>} array_array_of_model - */ - array_array_of_model = undefined; - - - - - - - } +/** + * @member {Array.} array_of_string + */ +ArrayTest.prototype['array_of_string'] = undefined; + +/** + * @member {Array.>} array_array_of_integer + */ +ArrayTest.prototype['array_array_of_integer'] = undefined; + +/** + * @member {Array.>} array_array_of_model + */ +ArrayTest.prototype['array_array_of_model'] = undefined; + + + + + + +export default ArrayTest; diff --git a/samples/client/petstore/javascript-es6/src/model/Capitalization.js b/samples/client/petstore/javascript-es6/src/model/Capitalization.js index 41c6ff9af30..bc1cdefb71b 100644 --- a/samples/client/petstore/javascript-es6/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-es6/src/model/Capitalization.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Capitalization model module. -* @module model/Capitalization -* @version 1.0.0 -*/ -export default class Capitalization { + * The Capitalization model module. + * @module model/Capitalization + * @version 1.0.0 + */ +class Capitalization { /** - * Constructs a new Capitalization. - * @alias module:model/Capitalization - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Capitalization. + * @alias module:model/Capitalization + */ + constructor() { + Capitalization.initialize(this); } /** - * Constructs a Capitalization from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Capitalization} obj Optional instance to populate. - * @return {module:model/Capitalization} The populated Capitalization instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Capitalization from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Capitalization} obj Optional instance to populate. + * @return {module:model/Capitalization} The populated Capitalization instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Capitalization(); - - - - if (data.hasOwnProperty('smallCamel')) { obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String'); } @@ -78,39 +69,44 @@ export default class Capitalization { return obj; } - /** - * @member {String} smallCamel - */ - smallCamel = undefined; - /** - * @member {String} CapitalCamel - */ - CapitalCamel = undefined; - /** - * @member {String} small_Snake - */ - small_Snake = undefined; - /** - * @member {String} Capital_Snake - */ - Capital_Snake = undefined; - /** - * @member {String} SCA_ETH_Flow_Points - */ - SCA_ETH_Flow_Points = undefined; - /** - * Name of the pet - * @member {String} ATT_NAME - */ - ATT_NAME = undefined; - - - - - - - } +/** + * @member {String} smallCamel + */ +Capitalization.prototype['smallCamel'] = undefined; + +/** + * @member {String} CapitalCamel + */ +Capitalization.prototype['CapitalCamel'] = undefined; + +/** + * @member {String} small_Snake + */ +Capitalization.prototype['small_Snake'] = undefined; + +/** + * @member {String} Capital_Snake + */ +Capitalization.prototype['Capital_Snake'] = undefined; + +/** + * @member {String} SCA_ETH_Flow_Points + */ +Capitalization.prototype['SCA_ETH_Flow_Points'] = undefined; + +/** + * Name of the pet + * @member {String} ATT_NAME + */ +Capitalization.prototype['ATT_NAME'] = undefined; + + + + + + +export default Capitalization; diff --git a/samples/client/petstore/javascript-es6/src/model/Cat.js b/samples/client/petstore/javascript-es6/src/model/Cat.js index cc759099886..5ad5fb40286 100644 --- a/samples/client/petstore/javascript-es6/src/model/Cat.js +++ b/samples/client/petstore/javascript-es6/src/model/Cat.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The Cat model module. -* @module model/Cat -* @version 1.0.0 -*/ -export default class Cat { + * The Cat model module. + * @module model/Cat + * @version 1.0.0 + */ +class Cat { /** - * Constructs a new Cat. - * @alias module:model/Cat - * @class - * @extends module:model/Animal - * @implements module:model/Animal - * @param className {} - */ - - constructor(className) { - - - Animal.call(this, className); - Animal.call(this, className); - - - - + * Constructs a new Cat. + * @alias module:model/Cat + * @extends module:model/Animal + * @implements module:model/Animal + * @param className {} + */ + constructor(className) { + Animal.initialize(this, className); + Cat.initialize(this, className); } /** - * Constructs a Cat from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Cat} obj Optional instance to populate. - * @return {module:model/Cat} The populated Cat instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a Cat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Cat} obj Optional instance to populate. + * @return {module:model/Cat} The populated Cat instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Cat(); - - - Animal.constructFromObject(data, obj); Animal.constructFromObject(data, obj); @@ -68,29 +60,28 @@ export default class Cat { return obj; } - /** - * @member {Boolean} declawed - */ - declawed = undefined; - - - // Implement Animal interface: - /** - * @member {String} className - */ - className = undefined; -/** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - } +/** + * @member {Boolean} declawed + */ +Cat.prototype['declawed'] = undefined; + + +// Implement Animal interface: +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + +export default Cat; diff --git a/samples/client/petstore/javascript-es6/src/model/Category.js b/samples/client/petstore/javascript-es6/src/model/Category.js index cdd487022d0..fd0bf79dafb 100644 --- a/samples/client/petstore/javascript-es6/src/model/Category.js +++ b/samples/client/petstore/javascript-es6/src/model/Category.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Category model module. -* @module model/Category -* @version 1.0.0 -*/ -export default class Category { + * The Category model module. + * @module model/Category + * @version 1.0.0 + */ +class Category { /** - * Constructs a new Category. - * @alias module:model/Category - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Category. + * @alias module:model/Category + */ + constructor() { + Category.initialize(this); } /** - * Constructs a Category from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Category} obj Optional instance to populate. - * @return {module:model/Category} The populated Category instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Category from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Category} obj Optional instance to populate. + * @return {module:model/Category} The populated Category instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Category(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -66,22 +57,23 @@ export default class Category { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} name - */ - name = undefined; - - - - - - - } +/** + * @member {Number} id + */ +Category.prototype['id'] = undefined; + +/** + * @member {String} name + */ +Category.prototype['name'] = undefined; + + + + + + +export default Category; diff --git a/samples/client/petstore/javascript-es6/src/model/ClassModel.js b/samples/client/petstore/javascript-es6/src/model/ClassModel.js index c9c39c22fff..2e55c2a6342 100644 --- a/samples/client/petstore/javascript-es6/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-es6/src/model/ClassModel.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ClassModel model module. -* @module model/ClassModel -* @version 1.0.0 -*/ -export default class ClassModel { + * The ClassModel model module. + * @module model/ClassModel + * @version 1.0.0 + */ +class ClassModel { /** - * Constructs a new ClassModel. - * Model for testing model with \"_class\" property - * @alias module:model/ClassModel - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ClassModel. + * Model for testing model with \"_class\" property + * @alias module:model/ClassModel + */ + constructor() { + ClassModel.initialize(this); } /** - * Constructs a ClassModel from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ClassModel} obj Optional instance to populate. - * @return {module:model/ClassModel} The populated ClassModel instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ClassModel from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ClassModel} obj Optional instance to populate. + * @return {module:model/ClassModel} The populated ClassModel instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ClassModel(); - - - - if (data.hasOwnProperty('_class')) { obj['_class'] = ApiClient.convertToType(data['_class'], 'String'); } @@ -64,18 +55,18 @@ export default class ClassModel { return obj; } - /** - * @member {String} _class - */ - _class = undefined; - - - - - - - } +/** + * @member {String} _class + */ +ClassModel.prototype['_class'] = undefined; + + + + + + +export default ClassModel; diff --git a/samples/client/petstore/javascript-es6/src/model/Client.js b/samples/client/petstore/javascript-es6/src/model/Client.js index 82dca1732b3..c506d2fa174 100644 --- a/samples/client/petstore/javascript-es6/src/model/Client.js +++ b/samples/client/petstore/javascript-es6/src/model/Client.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Client model module. -* @module model/Client -* @version 1.0.0 -*/ -export default class Client { + * The Client model module. + * @module model/Client + * @version 1.0.0 + */ +class Client { /** - * Constructs a new Client. - * @alias module:model/Client - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Client. + * @alias module:model/Client + */ + constructor() { + Client.initialize(this); } /** - * Constructs a Client from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Client} obj Optional instance to populate. - * @return {module:model/Client} The populated Client instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Client from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Client} obj Optional instance to populate. + * @return {module:model/Client} The populated Client instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Client(); - - - - if (data.hasOwnProperty('client')) { obj['client'] = ApiClient.convertToType(data['client'], 'String'); } @@ -63,18 +54,18 @@ export default class Client { return obj; } - /** - * @member {String} client - */ - client = undefined; - - - - - - - } +/** + * @member {String} client + */ +Client.prototype['client'] = undefined; + + + + + + +export default Client; diff --git a/samples/client/petstore/javascript-es6/src/model/Dog.js b/samples/client/petstore/javascript-es6/src/model/Dog.js index 92168904822..ba225630e93 100644 --- a/samples/client/petstore/javascript-es6/src/model/Dog.js +++ b/samples/client/petstore/javascript-es6/src/model/Dog.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The Dog model module. -* @module model/Dog -* @version 1.0.0 -*/ -export default class Dog { + * The Dog model module. + * @module model/Dog + * @version 1.0.0 + */ +class Dog { /** - * Constructs a new Dog. - * @alias module:model/Dog - * @class - * @extends module:model/Animal - * @implements module:model/Animal - * @param className {} - */ - - constructor(className) { - - - Animal.call(this, className); - Animal.call(this, className); - - - - + * Constructs a new Dog. + * @alias module:model/Dog + * @extends module:model/Animal + * @implements module:model/Animal + * @param className {} + */ + constructor(className) { + Animal.initialize(this, className); + Dog.initialize(this, className); } /** - * Constructs a Dog from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Dog} obj Optional instance to populate. - * @return {module:model/Dog} The populated Dog instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a Dog from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Dog} obj Optional instance to populate. + * @return {module:model/Dog} The populated Dog instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Dog(); - - - Animal.constructFromObject(data, obj); Animal.constructFromObject(data, obj); @@ -68,29 +60,28 @@ export default class Dog { return obj; } - /** - * @member {String} breed - */ - breed = undefined; - - - // Implement Animal interface: - /** - * @member {String} className - */ - className = undefined; -/** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - } +/** + * @member {String} breed + */ +Dog.prototype['breed'] = undefined; + + +// Implement Animal interface: +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + +export default Dog; diff --git a/samples/client/petstore/javascript-es6/src/model/EnumArrays.js b/samples/client/petstore/javascript-es6/src/model/EnumArrays.js index f017d9a5396..9426d4735ac 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumArrays.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The EnumArrays model module. -* @module model/EnumArrays -* @version 1.0.0 -*/ -export default class EnumArrays { + * The EnumArrays model module. + * @module model/EnumArrays + * @version 1.0.0 + */ +class EnumArrays { /** - * Constructs a new EnumArrays. - * @alias module:model/EnumArrays - * @class - */ - - constructor() { - - - - - - - + * Constructs a new EnumArrays. + * @alias module:model/EnumArrays + */ + constructor() { + EnumArrays.initialize(this); } /** - * Constructs a EnumArrays from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/EnumArrays} obj Optional instance to populate. - * @return {module:model/EnumArrays} The populated EnumArrays instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a EnumArrays from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumArrays} obj Optional instance to populate. + * @return {module:model/EnumArrays} The populated EnumArrays instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new EnumArrays(); - - - - if (data.hasOwnProperty('just_symbol')) { obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String'); } @@ -66,62 +57,65 @@ export default class EnumArrays { return obj; } - /** - * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol - */ - just_symbol = undefined; - /** - * @member {Array.} array_enum - */ - array_enum = undefined; - - - - - - - /** - * Allowed values for the just_symbol property. - * @enum {String} - * @readonly - */ - static JustSymbolEnum = { - - /** - * value: ">=" - * @const - */ - "GREATER_THAN_OR_EQUAL_TO": ">=", - - /** - * value: "$" - * @const - */ - "DOLLAR": "$" - }; - - /** - * Allowed values for the arrayEnum property. - * @enum {String} - * @readonly - */ - static ArrayEnumEnum = { - - /** - * value: "fish" - * @const - */ - "fish": "fish", - - /** - * value: "crab" - * @const - */ - "crab": "crab" - }; - - } +/** + * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol + */ +EnumArrays.prototype['just_symbol'] = undefined; + +/** + * @member {Array.} array_enum + */ +EnumArrays.prototype['array_enum'] = undefined; + + + + + +/** + * Allowed values for the just_symbol property. + * @enum {String} + * @readonly + */ +EnumArrays['JustSymbolEnum'] = { + + /** + * value: ">=" + * @const + */ + "GREATER_THAN_OR_EQUAL_TO": ">=", + + /** + * value: "$" + * @const + */ + "DOLLAR": "$" +}; + + +/** + * Allowed values for the arrayEnum property. + * @enum {String} + * @readonly + */ +EnumArrays['ArrayEnumEnum'] = { + + /** + * value: "fish" + * @const + */ + "fish": "fish", + + /** + * value: "crab" + * @const + */ + "crab": "crab" +}; + + + +export default EnumArrays; diff --git a/samples/client/petstore/javascript-es6/src/model/EnumClass.js b/samples/client/petstore/javascript-es6/src/model/EnumClass.js index feb022bc831..65ac9f1f1bc 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumClass.js @@ -11,10 +11,7 @@ * */ - import ApiClient from '../ApiClient'; - - /** * Enum class EnumClass. * @enum {} @@ -26,21 +23,21 @@ export default class EnumClass { * value: "_abc" * @const */ - _abc = "_abc"; + "_abc" = "_abc"; /** * value: "-efg" * @const */ - -efg = "-efg"; + "-efg" = "-efg"; /** * value: "(xyz)" * @const */ - (xyz) = "(xyz)"; + "(xyz)" = "(xyz)"; @@ -54,4 +51,3 @@ export default class EnumClass { } } - diff --git a/samples/client/petstore/javascript-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-es6/src/model/EnumTest.js index eaf874922b5..08828485c18 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumTest.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import OuterEnum from './OuterEnum'; - - - - /** -* The EnumTest model module. -* @module model/EnumTest -* @version 1.0.0 -*/ -export default class EnumTest { + * The EnumTest model module. + * @module model/EnumTest + * @version 1.0.0 + */ +class EnumTest { /** - * Constructs a new EnumTest. - * @alias module:model/EnumTest - * @class - * @param enumStringRequired {module:model/EnumTest.EnumStringRequiredEnum} - */ - - constructor(enumStringRequired) { - - - - - - this['enum_string_required'] = enumStringRequired; - + * Constructs a new EnumTest. + * @alias module:model/EnumTest + * @param enumStringRequired {module:model/EnumTest.EnumStringRequiredEnum} + */ + constructor(enumStringRequired) { + EnumTest.initialize(this, enumStringRequired); } /** - * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/EnumTest} obj Optional instance to populate. - * @return {module:model/EnumTest} The populated EnumTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, enumStringRequired) { + obj['enum_string_required'] = enumStringRequired; + } + + /** + * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumTest} obj Optional instance to populate. + * @return {module:model/EnumTest} The populated EnumTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new EnumTest(); - - - - if (data.hasOwnProperty('enum_string')) { obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); } @@ -77,126 +69,134 @@ export default class EnumTest { return obj; } - /** - * @member {module:model/EnumTest.EnumStringEnum} enum_string - */ - enum_string = undefined; - /** - * @member {module:model/EnumTest.EnumStringRequiredEnum} enum_string_required - */ - enum_string_required = undefined; - /** - * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer - */ - enum_integer = undefined; - /** - * @member {module:model/EnumTest.EnumNumberEnum} enum_number - */ - enum_number = undefined; - /** - * @member {module:model/OuterEnum} outerEnum - */ - outerEnum = undefined; - - - - - - - /** - * Allowed values for the enum_string property. - * @enum {String} - * @readonly - */ - static EnumStringEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower", - - /** - * value: "" - * @const - */ - "empty": "" - }; - - /** - * Allowed values for the enum_string_required property. - * @enum {String} - * @readonly - */ - static EnumStringRequiredEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower", - - /** - * value: "" - * @const - */ - "empty": "" - }; - - /** - * Allowed values for the enum_integer property. - * @enum {Number} - * @readonly - */ - static EnumIntegerEnum = { - - /** - * value: 1 - * @const - */ - "1": 1, - - /** - * value: -1 - * @const - */ - "-1": -1 - }; - - /** - * Allowed values for the enum_number property. - * @enum {Number} - * @readonly - */ - static EnumNumberEnum = { - - /** - * value: 1.1 - * @const - */ - "1.1": 1.1, - - /** - * value: -1.2 - * @const - */ - "-1.2": -1.2 - }; - - } +/** + * @member {module:model/EnumTest.EnumStringEnum} enum_string + */ +EnumTest.prototype['enum_string'] = undefined; + +/** + * @member {module:model/EnumTest.EnumStringRequiredEnum} enum_string_required + */ +EnumTest.prototype['enum_string_required'] = undefined; + +/** + * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer + */ +EnumTest.prototype['enum_integer'] = undefined; + +/** + * @member {module:model/EnumTest.EnumNumberEnum} enum_number + */ +EnumTest.prototype['enum_number'] = undefined; + +/** + * @member {module:model/OuterEnum} outerEnum + */ +EnumTest.prototype['outerEnum'] = undefined; + + + + + +/** + * Allowed values for the enum_string property. + * @enum {String} + * @readonly + */ +EnumTest['EnumStringEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" +}; + + +/** + * Allowed values for the enum_string_required property. + * @enum {String} + * @readonly + */ +EnumTest['EnumStringRequiredEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" +}; + + +/** + * Allowed values for the enum_integer property. + * @enum {Number} + * @readonly + */ +EnumTest['EnumIntegerEnum'] = { + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: -1 + * @const + */ + "-1": -1 +}; + + +/** + * Allowed values for the enum_number property. + * @enum {Number} + * @readonly + */ +EnumTest['EnumNumberEnum'] = { + + /** + * value: 1.1 + * @const + */ + "1.1": 1.1, + + /** + * value: -1.2 + * @const + */ + "-1.2": -1.2 +}; + + + +export default EnumTest; diff --git a/samples/client/petstore/javascript-es6/src/model/FormatTest.js b/samples/client/petstore/javascript-es6/src/model/FormatTest.js index 7d04ffd26d3..87fa2afe86b 100644 --- a/samples/client/petstore/javascript-es6/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-es6/src/model/FormatTest.js @@ -11,55 +11,50 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The FormatTest model module. -* @module model/FormatTest -* @version 1.0.0 -*/ -export default class FormatTest { + * The FormatTest model module. + * @module model/FormatTest + * @version 1.0.0 + */ +class FormatTest { /** - * Constructs a new FormatTest. - * @alias module:model/FormatTest - * @class - * @param _number {Number} - * @param _byte {Blob} - * @param _date {Date} - * @param password {String} - */ - - constructor(_number, _byte, _date, password) { - - - - - - this['number'] = _number;this['byte'] = _byte;this['date'] = _date;this['password'] = password; - + * Constructs a new FormatTest. + * @alias module:model/FormatTest + * @param _number {Number} + * @param _byte {Blob} + * @param _date {Date} + * @param password {String} + */ + constructor(_number, _byte, _date, password) { + FormatTest.initialize(this, _number, _byte, _date, password); } /** - * Constructs a FormatTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/FormatTest} obj Optional instance to populate. - * @return {module:model/FormatTest} The populated FormatTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, _number, _byte, _date, password) { + obj['number'] = _number; + obj['byte'] = _byte; + obj['date'] = _date; + obj['password'] = password; + } + + /** + * Constructs a FormatTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/FormatTest} obj Optional instance to populate. + * @return {module:model/FormatTest} The populated FormatTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new FormatTest(); - - - - if (data.hasOwnProperty('integer')) { obj['integer'] = ApiClient.convertToType(data['integer'], 'Number'); } @@ -103,66 +98,78 @@ export default class FormatTest { return obj; } - /** - * @member {Number} integer - */ - integer = undefined; - /** - * @member {Number} int32 - */ - int32 = undefined; - /** - * @member {Number} int64 - */ - int64 = undefined; - /** - * @member {Number} number - */ - number = undefined; - /** - * @member {Number} float - */ - float = undefined; - /** - * @member {Number} double - */ - double = undefined; - /** - * @member {String} string - */ - string = undefined; - /** - * @member {Blob} byte - */ - byte = undefined; - /** - * @member {File} binary - */ - binary = undefined; - /** - * @member {Date} date - */ - date = undefined; - /** - * @member {Date} dateTime - */ - dateTime = undefined; - /** - * @member {String} uuid - */ - uuid = undefined; - /** - * @member {String} password - */ - password = undefined; - - - - - - - } +/** + * @member {Number} integer + */ +FormatTest.prototype['integer'] = undefined; + +/** + * @member {Number} int32 + */ +FormatTest.prototype['int32'] = undefined; + +/** + * @member {Number} int64 + */ +FormatTest.prototype['int64'] = undefined; + +/** + * @member {Number} number + */ +FormatTest.prototype['number'] = undefined; + +/** + * @member {Number} float + */ +FormatTest.prototype['float'] = undefined; + +/** + * @member {Number} double + */ +FormatTest.prototype['double'] = undefined; + +/** + * @member {String} string + */ +FormatTest.prototype['string'] = undefined; + +/** + * @member {Blob} byte + */ +FormatTest.prototype['byte'] = undefined; + +/** + * @member {File} binary + */ +FormatTest.prototype['binary'] = undefined; + +/** + * @member {Date} date + */ +FormatTest.prototype['date'] = undefined; + +/** + * @member {Date} dateTime + */ +FormatTest.prototype['dateTime'] = undefined; + +/** + * @member {String} uuid + */ +FormatTest.prototype['uuid'] = undefined; + +/** + * @member {String} password + */ +FormatTest.prototype['password'] = undefined; + + + + + + +export default FormatTest; diff --git a/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js index e5f746c32ba..9c11ae559c9 100644 --- a/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The HasOnlyReadOnly model module. -* @module model/HasOnlyReadOnly -* @version 1.0.0 -*/ -export default class HasOnlyReadOnly { + * The HasOnlyReadOnly model module. + * @module model/HasOnlyReadOnly + * @version 1.0.0 + */ +class HasOnlyReadOnly { /** - * Constructs a new HasOnlyReadOnly. - * @alias module:model/HasOnlyReadOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new HasOnlyReadOnly. + * @alias module:model/HasOnlyReadOnly + */ + constructor() { + HasOnlyReadOnly.initialize(this); } /** - * Constructs a HasOnlyReadOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/HasOnlyReadOnly} obj Optional instance to populate. - * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a HasOnlyReadOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/HasOnlyReadOnly} obj Optional instance to populate. + * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new HasOnlyReadOnly(); - - - - if (data.hasOwnProperty('bar')) { obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); } @@ -66,22 +57,23 @@ export default class HasOnlyReadOnly { return obj; } - /** - * @member {String} bar - */ - bar = undefined; - /** - * @member {String} foo - */ - foo = undefined; - - - - - - - } +/** + * @member {String} bar + */ +HasOnlyReadOnly.prototype['bar'] = undefined; + +/** + * @member {String} foo + */ +HasOnlyReadOnly.prototype['foo'] = undefined; + + + + + + +export default HasOnlyReadOnly; diff --git a/samples/client/petstore/javascript-es6/src/model/List.js b/samples/client/petstore/javascript-es6/src/model/List.js index 67d6d9ef144..d4d342319e7 100644 --- a/samples/client/petstore/javascript-es6/src/model/List.js +++ b/samples/client/petstore/javascript-es6/src/model/List.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The List model module. -* @module model/List -* @version 1.0.0 -*/ -export default class List { + * The List model module. + * @module model/List + * @version 1.0.0 + */ +class List { /** - * Constructs a new List. - * @alias module:model/List - * @class - */ - - constructor() { - - - - - - - + * Constructs a new List. + * @alias module:model/List + */ + constructor() { + List.initialize(this); } /** - * Constructs a List from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/List} obj Optional instance to populate. - * @return {module:model/List} The populated List instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a List from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/List} obj Optional instance to populate. + * @return {module:model/List} The populated List instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new List(); - - - - if (data.hasOwnProperty('123-list')) { obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String'); } @@ -63,18 +54,18 @@ export default class List { return obj; } - /** - * @member {String} 123-list - */ - 123-list = undefined; - - - - - - - } +/** + * @member {String} 123-list + */ +List.prototype['123-list'] = undefined; + + + + + + +export default List; diff --git a/samples/client/petstore/javascript-es6/src/model/MapTest.js b/samples/client/petstore/javascript-es6/src/model/MapTest.js index e4be468e253..8cc6640c9d4 100644 --- a/samples/client/petstore/javascript-es6/src/model/MapTest.js +++ b/samples/client/petstore/javascript-es6/src/model/MapTest.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The MapTest model module. -* @module model/MapTest -* @version 1.0.0 -*/ -export default class MapTest { + * The MapTest model module. + * @module model/MapTest + * @version 1.0.0 + */ +class MapTest { /** - * Constructs a new MapTest. - * @alias module:model/MapTest - * @class - */ - - constructor() { - - - - - - - + * Constructs a new MapTest. + * @alias module:model/MapTest + */ + constructor() { + MapTest.initialize(this); } /** - * Constructs a MapTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/MapTest} obj Optional instance to populate. - * @return {module:model/MapTest} The populated MapTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a MapTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MapTest} obj Optional instance to populate. + * @return {module:model/MapTest} The populated MapTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new MapTest(); - - - - if (data.hasOwnProperty('map_map_of_string')) { obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}}); } @@ -66,42 +57,44 @@ export default class MapTest { return obj; } - /** - * @member {Object.>} map_map_of_string - */ - map_map_of_string = undefined; - /** - * @member {Object.} map_of_enum_string - */ - map_of_enum_string = undefined; - - - - - - - /** - * Allowed values for the inner property. - * @enum {String} - * @readonly - */ - static InnerEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower" - }; - - } +/** + * @member {Object.>} map_map_of_string + */ +MapTest.prototype['map_map_of_string'] = undefined; + +/** + * @member {Object.} map_of_enum_string + */ +MapTest.prototype['map_of_enum_string'] = undefined; + + + + + +/** + * Allowed values for the inner property. + * @enum {String} + * @readonly + */ +MapTest['InnerEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower" +}; + + + +export default MapTest; diff --git a/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 17ea09bd69a..5568d3a6e96 100644 --- a/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The MixedPropertiesAndAdditionalPropertiesClass model module. -* @module model/MixedPropertiesAndAdditionalPropertiesClass -* @version 1.0.0 -*/ -export default class MixedPropertiesAndAdditionalPropertiesClass { + * The MixedPropertiesAndAdditionalPropertiesClass model module. + * @module model/MixedPropertiesAndAdditionalPropertiesClass + * @version 1.0.0 + */ +class MixedPropertiesAndAdditionalPropertiesClass { /** - * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. - * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass - * @class - */ - - constructor() { - - - - - - - + * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. + * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass + */ + constructor() { + MixedPropertiesAndAdditionalPropertiesClass.initialize(this); } /** - * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. - * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new MixedPropertiesAndAdditionalPropertiesClass(); - - - - if (data.hasOwnProperty('uuid')) { obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); } @@ -70,26 +61,28 @@ export default class MixedPropertiesAndAdditionalPropertiesClass { return obj; } - /** - * @member {String} uuid - */ - uuid = undefined; - /** - * @member {Date} dateTime - */ - dateTime = undefined; - /** - * @member {Object.} map - */ - map = undefined; - - - - - - - } +/** + * @member {String} uuid + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['uuid'] = undefined; + +/** + * @member {Date} dateTime + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['dateTime'] = undefined; + +/** + * @member {Object.} map + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['map'] = undefined; + + + + + + +export default MixedPropertiesAndAdditionalPropertiesClass; diff --git a/samples/client/petstore/javascript-es6/src/model/Model200Response.js b/samples/client/petstore/javascript-es6/src/model/Model200Response.js index 3dbecac1336..629b0f0c75a 100644 --- a/samples/client/petstore/javascript-es6/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-es6/src/model/Model200Response.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Model200Response model module. -* @module model/Model200Response -* @version 1.0.0 -*/ -export default class Model200Response { + * The Model200Response model module. + * @module model/Model200Response + * @version 1.0.0 + */ +class Model200Response { /** - * Constructs a new Model200Response. - * Model for testing model name starting with number - * @alias module:model/Model200Response - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Model200Response. + * Model for testing model name starting with number + * @alias module:model/Model200Response + */ + constructor() { + Model200Response.initialize(this); } /** - * Constructs a Model200Response from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Model200Response} obj Optional instance to populate. - * @return {module:model/Model200Response} The populated Model200Response instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Model200Response from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Model200Response} obj Optional instance to populate. + * @return {module:model/Model200Response} The populated Model200Response instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Model200Response(); - - - - if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'Number'); } @@ -67,22 +58,23 @@ export default class Model200Response { return obj; } - /** - * @member {Number} name - */ - name = undefined; - /** - * @member {String} class - */ - class = undefined; - - - - - - - } +/** + * @member {Number} name + */ +Model200Response.prototype['name'] = undefined; + +/** + * @member {String} class + */ +Model200Response.prototype['class'] = undefined; + + + + + + +export default Model200Response; diff --git a/samples/client/petstore/javascript-es6/src/model/ModelReturn.js b/samples/client/petstore/javascript-es6/src/model/ModelReturn.js index 0f287b72281..9ad0c11befc 100644 --- a/samples/client/petstore/javascript-es6/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-es6/src/model/ModelReturn.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ModelReturn model module. -* @module model/ModelReturn -* @version 1.0.0 -*/ -export default class ModelReturn { + * The ModelReturn model module. + * @module model/ModelReturn + * @version 1.0.0 + */ +class ModelReturn { /** - * Constructs a new ModelReturn. - * Model for testing reserved words - * @alias module:model/ModelReturn - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ModelReturn. + * Model for testing reserved words + * @alias module:model/ModelReturn + */ + constructor() { + ModelReturn.initialize(this); } /** - * Constructs a ModelReturn from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ModelReturn} obj Optional instance to populate. - * @return {module:model/ModelReturn} The populated ModelReturn instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ModelReturn from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ModelReturn} obj Optional instance to populate. + * @return {module:model/ModelReturn} The populated ModelReturn instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ModelReturn(); - - - - if (data.hasOwnProperty('return')) { obj['return'] = ApiClient.convertToType(data['return'], 'Number'); } @@ -64,18 +55,18 @@ export default class ModelReturn { return obj; } - /** - * @member {Number} return - */ - return = undefined; - - - - - - - } +/** + * @member {Number} return + */ +ModelReturn.prototype['return'] = undefined; + + + + + + +export default ModelReturn; diff --git a/samples/client/petstore/javascript-es6/src/model/Name.js b/samples/client/petstore/javascript-es6/src/model/Name.js index 0da2f21ca4c..63e7d52e5ff 100644 --- a/samples/client/petstore/javascript-es6/src/model/Name.js +++ b/samples/client/petstore/javascript-es6/src/model/Name.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Name model module. -* @module model/Name -* @version 1.0.0 -*/ -export default class Name { + * The Name model module. + * @module model/Name + * @version 1.0.0 + */ +class Name { /** - * Constructs a new Name. - * Model for testing model name same as property name - * @alias module:model/Name - * @class - * @param name {Number} - */ - - constructor(name) { - - - - - - this['name'] = name; - + * Constructs a new Name. + * Model for testing model name same as property name + * @alias module:model/Name + * @param name {Number} + */ + constructor(name) { + Name.initialize(this, name); } /** - * Constructs a Name from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Name} obj Optional instance to populate. - * @return {module:model/Name} The populated Name instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name) { + obj['name'] = name; + } + + /** + * Constructs a Name from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Name} obj Optional instance to populate. + * @return {module:model/Name} The populated Name instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Name(); - - - - if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'Number'); } @@ -74,30 +66,33 @@ export default class Name { return obj; } - /** - * @member {Number} name - */ - name = undefined; - /** - * @member {Number} snake_case - */ - snake_case = undefined; - /** - * @member {String} property - */ - property = undefined; - /** - * @member {Number} 123Number - */ - 123Number = undefined; - - - - - - - } +/** + * @member {Number} name + */ +Name.prototype['name'] = undefined; + +/** + * @member {Number} snake_case + */ +Name.prototype['snake_case'] = undefined; + +/** + * @member {String} property + */ +Name.prototype['property'] = undefined; + +/** + * @member {Number} 123Number + */ +Name.prototype['123Number'] = undefined; + + + + + + +export default Name; diff --git a/samples/client/petstore/javascript-es6/src/model/NumberOnly.js b/samples/client/petstore/javascript-es6/src/model/NumberOnly.js index e1f7978f7f6..ec5ad812b40 100644 --- a/samples/client/petstore/javascript-es6/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/NumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The NumberOnly model module. -* @module model/NumberOnly -* @version 1.0.0 -*/ -export default class NumberOnly { + * The NumberOnly model module. + * @module model/NumberOnly + * @version 1.0.0 + */ +class NumberOnly { /** - * Constructs a new NumberOnly. - * @alias module:model/NumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new NumberOnly. + * @alias module:model/NumberOnly + */ + constructor() { + NumberOnly.initialize(this); } /** - * Constructs a NumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/NumberOnly} obj Optional instance to populate. - * @return {module:model/NumberOnly} The populated NumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a NumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/NumberOnly} obj Optional instance to populate. + * @return {module:model/NumberOnly} The populated NumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new NumberOnly(); - - - - if (data.hasOwnProperty('JustNumber')) { obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number'); } @@ -63,18 +54,18 @@ export default class NumberOnly { return obj; } - /** - * @member {Number} JustNumber - */ - JustNumber = undefined; - - - - - - - } +/** + * @member {Number} JustNumber + */ +NumberOnly.prototype['JustNumber'] = undefined; + + + + + + +export default NumberOnly; diff --git a/samples/client/petstore/javascript-es6/src/model/Order.js b/samples/client/petstore/javascript-es6/src/model/Order.js index fb8bdd4ab9f..8c07a5cd0f3 100644 --- a/samples/client/petstore/javascript-es6/src/model/Order.js +++ b/samples/client/petstore/javascript-es6/src/model/Order.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Order model module. -* @module model/Order -* @version 1.0.0 -*/ -export default class Order { + * The Order model module. + * @module model/Order + * @version 1.0.0 + */ +class Order { /** - * Constructs a new Order. - * @alias module:model/Order - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Order. + * @alias module:model/Order + */ + constructor() { + Order.initialize(this); } /** - * Constructs a Order from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Order} obj Optional instance to populate. - * @return {module:model/Order} The populated Order instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Order from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Order} obj Optional instance to populate. + * @return {module:model/Order} The populated Order instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Order(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -78,66 +69,72 @@ export default class Order { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {Number} petId - */ - petId = undefined; - /** - * @member {Number} quantity - */ - quantity = undefined; - /** - * @member {Date} shipDate - */ - shipDate = undefined; - /** - * Order Status - * @member {module:model/Order.StatusEnum} status - */ - status = undefined; - /** - * @member {Boolean} complete - * @default false - */ - complete = false; - - - - - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - static StatusEnum = { - - /** - * value: "placed" - * @const - */ - "placed": "placed", - - /** - * value: "approved" - * @const - */ - "approved": "approved", - - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" - }; - - } +/** + * @member {Number} id + */ +Order.prototype['id'] = undefined; + +/** + * @member {Number} petId + */ +Order.prototype['petId'] = undefined; + +/** + * @member {Number} quantity + */ +Order.prototype['quantity'] = undefined; + +/** + * @member {Date} shipDate + */ +Order.prototype['shipDate'] = undefined; + +/** + * Order Status + * @member {module:model/Order.StatusEnum} status + */ +Order.prototype['status'] = undefined; + +/** + * @member {Boolean} complete + * @default false + */ +Order.prototype['complete'] = false; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +Order['StatusEnum'] = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" +}; + + + +export default Order; diff --git a/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js b/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js deleted file mode 100644 index 592a0b69864..00000000000 --- a/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterBoolean model module. -* @module model/OuterBoolean -* @version 1.0.0 -*/ -export default class OuterBoolean { - /** - * Constructs a new OuterBoolean. - * @alias module:model/OuterBoolean - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterBoolean from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterBoolean} obj Optional instance to populate. - * @return {module:model/OuterBoolean} The populated OuterBoolean instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterBoolean(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-es6/src/model/OuterComposite.js b/samples/client/petstore/javascript-es6/src/model/OuterComposite.js index ebacb2837d8..8b61cb8f654 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterComposite.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The OuterComposite model module. -* @module model/OuterComposite -* @version 1.0.0 -*/ -export default class OuterComposite { + * The OuterComposite model module. + * @module model/OuterComposite + * @version 1.0.0 + */ +class OuterComposite { /** - * Constructs a new OuterComposite. - * @alias module:model/OuterComposite - * @class - */ - - constructor() { - - - - - - - + * Constructs a new OuterComposite. + * @alias module:model/OuterComposite + */ + constructor() { + OuterComposite.initialize(this); } /** - * Constructs a OuterComposite from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterComposite} obj Optional instance to populate. - * @return {module:model/OuterComposite} The populated OuterComposite instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a OuterComposite from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OuterComposite} obj Optional instance to populate. + * @return {module:model/OuterComposite} The populated OuterComposite instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new OuterComposite(); - - - - if (data.hasOwnProperty('my_number')) { obj['my_number'] = 'Number'.constructFromObject(data['my_number']); } @@ -69,26 +60,28 @@ export default class OuterComposite { return obj; } - /** - * @member {Number} my_number - */ - my_number = undefined; - /** - * @member {String} my_string - */ - my_string = undefined; - /** - * @member {Boolean} my_boolean - */ - my_boolean = undefined; - - - - - - - } +/** + * @member {Number} my_number + */ +OuterComposite.prototype['my_number'] = undefined; + +/** + * @member {String} my_string + */ +OuterComposite.prototype['my_string'] = undefined; + +/** + * @member {Boolean} my_boolean + */ +OuterComposite.prototype['my_boolean'] = undefined; + + + + + + +export default OuterComposite; diff --git a/samples/client/petstore/javascript-es6/src/model/OuterEnum.js b/samples/client/petstore/javascript-es6/src/model/OuterEnum.js index a31e00b729d..0404b03b061 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterEnum.js @@ -11,10 +11,7 @@ * */ - import ApiClient from '../ApiClient'; - - /** * Enum class OuterEnum. * @enum {} @@ -26,21 +23,21 @@ export default class OuterEnum { * value: "placed" * @const */ - placed = "placed"; + "placed" = "placed"; /** * value: "approved" * @const */ - approved = "approved"; + "approved" = "approved"; /** * value: "delivered" * @const */ - delivered = "delivered"; + "delivered" = "delivered"; @@ -54,4 +51,3 @@ export default class OuterEnum { } } - diff --git a/samples/client/petstore/javascript-es6/src/model/OuterNumber.js b/samples/client/petstore/javascript-es6/src/model/OuterNumber.js deleted file mode 100644 index ff65b1588b7..00000000000 --- a/samples/client/petstore/javascript-es6/src/model/OuterNumber.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterNumber model module. -* @module model/OuterNumber -* @version 1.0.0 -*/ -export default class OuterNumber { - /** - * Constructs a new OuterNumber. - * @alias module:model/OuterNumber - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterNumber from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterNumber} obj Optional instance to populate. - * @return {module:model/OuterNumber} The populated OuterNumber instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterNumber(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-es6/src/model/OuterString.js b/samples/client/petstore/javascript-es6/src/model/OuterString.js deleted file mode 100644 index 6921029ede1..00000000000 --- a/samples/client/petstore/javascript-es6/src/model/OuterString.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterString model module. -* @module model/OuterString -* @version 1.0.0 -*/ -export default class OuterString { - /** - * Constructs a new OuterString. - * @alias module:model/OuterString - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterString from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterString} obj Optional instance to populate. - * @return {module:model/OuterString} The populated OuterString instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterString(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-es6/src/model/Pet.js b/samples/client/petstore/javascript-es6/src/model/Pet.js index 4edbd6e3d75..37b987fdf81 100644 --- a/samples/client/petstore/javascript-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-es6/src/model/Pet.js @@ -11,55 +11,48 @@ * */ - import ApiClient from '../ApiClient'; import Category from './Category'; import Tag from './Tag'; - - - - /** -* The Pet model module. -* @module model/Pet -* @version 1.0.0 -*/ -export default class Pet { + * The Pet model module. + * @module model/Pet + * @version 1.0.0 + */ +class Pet { /** - * Constructs a new Pet. - * @alias module:model/Pet - * @class - * @param name {String} - * @param photoUrls {Array.} - */ - - constructor(name, photoUrls) { - - - - - - this['name'] = name;this['photoUrls'] = photoUrls; - + * Constructs a new Pet. + * @alias module:model/Pet + * @param name {String} + * @param photoUrls {Array.} + */ + constructor(name, photoUrls) { + Pet.initialize(this, name, photoUrls); } /** - * Constructs a Pet from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Pet} obj Optional instance to populate. - * @return {module:model/Pet} The populated Pet instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name, photoUrls) { + obj['name'] = name; + obj['photoUrls'] = photoUrls; + } + + /** + * Constructs a Pet from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Pet} obj Optional instance to populate. + * @return {module:model/Pet} The populated Pet instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Pet(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -82,65 +75,71 @@ export default class Pet { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {module:model/Category} category - */ - category = undefined; - /** - * @member {String} name - */ - name = undefined; - /** - * @member {Array.} photoUrls - */ - photoUrls = undefined; - /** - * @member {Array.} tags - */ - tags = undefined; - /** - * pet status in the store - * @member {module:model/Pet.StatusEnum} status - */ - status = undefined; - - - - - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - static StatusEnum = { - - /** - * value: "available" - * @const - */ - "available": "available", - - /** - * value: "pending" - * @const - */ - "pending": "pending", - - /** - * value: "sold" - * @const - */ - "sold": "sold" - }; - - } +/** + * @member {Number} id + */ +Pet.prototype['id'] = undefined; + +/** + * @member {module:model/Category} category + */ +Pet.prototype['category'] = undefined; + +/** + * @member {String} name + */ +Pet.prototype['name'] = undefined; + +/** + * @member {Array.} photoUrls + */ +Pet.prototype['photoUrls'] = undefined; + +/** + * @member {Array.} tags + */ +Pet.prototype['tags'] = undefined; + +/** + * pet status in the store + * @member {module:model/Pet.StatusEnum} status + */ +Pet.prototype['status'] = undefined; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +Pet['StatusEnum'] = { + + /** + * value: "available" + * @const + */ + "available": "available", + + /** + * value: "pending" + * @const + */ + "pending": "pending", + + /** + * value: "sold" + * @const + */ + "sold": "sold" +}; + + + +export default Pet; diff --git a/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js index 5aee0fce320..289277c191d 100644 --- a/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ReadOnlyFirst model module. -* @module model/ReadOnlyFirst -* @version 1.0.0 -*/ -export default class ReadOnlyFirst { + * The ReadOnlyFirst model module. + * @module model/ReadOnlyFirst + * @version 1.0.0 + */ +class ReadOnlyFirst { /** - * Constructs a new ReadOnlyFirst. - * @alias module:model/ReadOnlyFirst - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ReadOnlyFirst. + * @alias module:model/ReadOnlyFirst + */ + constructor() { + ReadOnlyFirst.initialize(this); } /** - * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. - * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. + * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ReadOnlyFirst(); - - - - if (data.hasOwnProperty('bar')) { obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); } @@ -66,22 +57,23 @@ export default class ReadOnlyFirst { return obj; } - /** - * @member {String} bar - */ - bar = undefined; - /** - * @member {String} baz - */ - baz = undefined; - - - - - - - } +/** + * @member {String} bar + */ +ReadOnlyFirst.prototype['bar'] = undefined; + +/** + * @member {String} baz + */ +ReadOnlyFirst.prototype['baz'] = undefined; + + + + + + +export default ReadOnlyFirst; diff --git a/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js b/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js index c00da7303e9..be9f36a855f 100644 --- a/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The SpecialModelName model module. -* @module model/SpecialModelName -* @version 1.0.0 -*/ -export default class SpecialModelName { + * The SpecialModelName model module. + * @module model/SpecialModelName + * @version 1.0.0 + */ +class SpecialModelName { /** - * Constructs a new SpecialModelName. - * @alias module:model/SpecialModelName - * @class - */ - - constructor() { - - - - - - - + * Constructs a new SpecialModelName. + * @alias module:model/SpecialModelName + */ + constructor() { + SpecialModelName.initialize(this); } /** - * Constructs a SpecialModelName from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/SpecialModelName} obj Optional instance to populate. - * @return {module:model/SpecialModelName} The populated SpecialModelName instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a SpecialModelName from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SpecialModelName} obj Optional instance to populate. + * @return {module:model/SpecialModelName} The populated SpecialModelName instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new SpecialModelName(); - - - - if (data.hasOwnProperty('$special[property.name]')) { obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number'); } @@ -63,18 +54,18 @@ export default class SpecialModelName { return obj; } - /** - * @member {Number} $special[property.name] - */ - $special[property.name] = undefined; - - - - - - - } +/** + * @member {Number} $special[property.name] + */ +SpecialModelName.prototype['$special[property.name]'] = undefined; + + + + + + +export default SpecialModelName; diff --git a/samples/client/petstore/javascript-es6/src/model/Tag.js b/samples/client/petstore/javascript-es6/src/model/Tag.js index 994da23e2a7..0d39a36833a 100644 --- a/samples/client/petstore/javascript-es6/src/model/Tag.js +++ b/samples/client/petstore/javascript-es6/src/model/Tag.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Tag model module. -* @module model/Tag -* @version 1.0.0 -*/ -export default class Tag { + * The Tag model module. + * @module model/Tag + * @version 1.0.0 + */ +class Tag { /** - * Constructs a new Tag. - * @alias module:model/Tag - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Tag. + * @alias module:model/Tag + */ + constructor() { + Tag.initialize(this); } /** - * Constructs a Tag from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Tag} obj Optional instance to populate. - * @return {module:model/Tag} The populated Tag instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Tag from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Tag} obj Optional instance to populate. + * @return {module:model/Tag} The populated Tag instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Tag(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -66,22 +57,23 @@ export default class Tag { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} name - */ - name = undefined; - - - - - - - } +/** + * @member {Number} id + */ +Tag.prototype['id'] = undefined; + +/** + * @member {String} name + */ +Tag.prototype['name'] = undefined; + + + + + + +export default Tag; diff --git a/samples/client/petstore/javascript-es6/src/model/User.js b/samples/client/petstore/javascript-es6/src/model/User.js index c0f5ef56e6f..7f8e2848e18 100644 --- a/samples/client/petstore/javascript-es6/src/model/User.js +++ b/samples/client/petstore/javascript-es6/src/model/User.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The User model module. -* @module model/User -* @version 1.0.0 -*/ -export default class User { + * The User model module. + * @module model/User + * @version 1.0.0 + */ +class User { /** - * Constructs a new User. - * @alias module:model/User - * @class - */ - - constructor() { - - - - - - - + * Constructs a new User. + * @alias module:model/User + */ + constructor() { + User.initialize(this); } /** - * Constructs a User from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/User} obj Optional instance to populate. - * @return {module:model/User} The populated User instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a User from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/User} obj Optional instance to populate. + * @return {module:model/User} The populated User instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new User(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -84,47 +75,54 @@ export default class User { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} username - */ - username = undefined; - /** - * @member {String} firstName - */ - firstName = undefined; - /** - * @member {String} lastName - */ - lastName = undefined; - /** - * @member {String} email - */ - email = undefined; - /** - * @member {String} password - */ - password = undefined; - /** - * @member {String} phone - */ - phone = undefined; - /** - * User Status - * @member {Number} userStatus - */ - userStatus = undefined; - - - - - - - } +/** + * @member {Number} id + */ +User.prototype['id'] = undefined; + +/** + * @member {String} username + */ +User.prototype['username'] = undefined; + +/** + * @member {String} firstName + */ +User.prototype['firstName'] = undefined; + +/** + * @member {String} lastName + */ +User.prototype['lastName'] = undefined; + +/** + * @member {String} email + */ +User.prototype['email'] = undefined; + +/** + * @member {String} password + */ +User.prototype['password'] = undefined; + +/** + * @member {String} phone + */ +User.prototype['phone'] = undefined; + +/** + * User Status + * @member {Number} userStatus + */ +User.prototype['userStatus'] = undefined; + + + + + + +export default User; diff --git a/samples/client/petstore/javascript-es6/src/test/ApiClientTest.js b/samples/client/petstore/javascript-es6/src/test/ApiClientTest.js new file mode 100644 index 00000000000..5e98b685a91 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/samples/client/petstore/javascript-es6/src/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/AnotherFakeApi.spec.js new file mode 100644 index 00000000000..f55538a53e7 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,63 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/FakeApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/FakeApi.spec.js new file mode 100644 index 00000000000..f2903d6612c --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/FakeApi.spec.js @@ -0,0 +1,123 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeApi', function() { + describe('fakeOuterBooleanSerialize', function() { + it('should call fakeOuterBooleanSerialize successfully', function(done) { + //uncomment below and update the code to test fakeOuterBooleanSerialize + //instance.fakeOuterBooleanSerialize(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('fakeOuterCompositeSerialize', function() { + it('should call fakeOuterCompositeSerialize successfully', function(done) { + //uncomment below and update the code to test fakeOuterCompositeSerialize + //instance.fakeOuterCompositeSerialize(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('fakeOuterNumberSerialize', function() { + it('should call fakeOuterNumberSerialize successfully', function(done) { + //uncomment below and update the code to test fakeOuterNumberSerialize + //instance.fakeOuterNumberSerialize(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('fakeOuterStringSerialize', function() { + it('should call fakeOuterStringSerialize successfully', function(done) { + //uncomment below and update the code to test fakeOuterStringSerialize + //instance.fakeOuterStringSerialize(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('testClientModel', function() { + it('should call testClientModel successfully', function(done) { + //uncomment below and update the code to test testClientModel + //instance.testClientModel(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('testEndpointParameters', function() { + it('should call testEndpointParameters successfully', function(done) { + //uncomment below and update the code to test testEndpointParameters + //instance.testEndpointParameters(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('testEnumParameters', function() { + it('should call testEnumParameters successfully', function(done) { + //uncomment below and update the code to test testEnumParameters + //instance.testEnumParameters(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-es6/src/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 00000000000..10e20e7778a --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,63 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/PetApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/PetApi.spec.js new file mode 100644 index 00000000000..5259a2c6665 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/PetApi.spec.js @@ -0,0 +1,133 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.PetApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('PetApi', function() { + describe('addPet', function() { + it('should call addPet successfully', function(done) { + //uncomment below and update the code to test addPet + //instance.addPet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deletePet', function() { + it('should call deletePet successfully', function(done) { + //uncomment below and update the code to test deletePet + //instance.deletePet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('findPetsByStatus', function() { + it('should call findPetsByStatus successfully', function(done) { + //uncomment below and update the code to test findPetsByStatus + //instance.findPetsByStatus(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('findPetsByTags', function() { + it('should call findPetsByTags successfully', function(done) { + //uncomment below and update the code to test findPetsByTags + //instance.findPetsByTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getPetById', function() { + it('should call getPetById successfully', function(done) { + //uncomment below and update the code to test getPetById + //instance.getPetById(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updatePet', function() { + it('should call updatePet successfully', function(done) { + //uncomment below and update the code to test updatePet + //instance.updatePet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updatePetWithForm', function() { + it('should call updatePetWithForm successfully', function(done) { + //uncomment below and update the code to test updatePetWithForm + //instance.updatePetWithForm(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('uploadFile', function() { + it('should call uploadFile successfully', function(done) { + //uncomment below and update the code to test uploadFile + //instance.uploadFile(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/StoreApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/StoreApi.spec.js new file mode 100644 index 00000000000..d19da2f28d8 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/StoreApi.spec.js @@ -0,0 +1,93 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.StoreApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('StoreApi', function() { + describe('deleteOrder', function() { + it('should call deleteOrder successfully', function(done) { + //uncomment below and update the code to test deleteOrder + //instance.deleteOrder(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getInventory', function() { + it('should call getInventory successfully', function(done) { + //uncomment below and update the code to test getInventory + //instance.getInventory(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getOrderById', function() { + it('should call getOrderById successfully', function(done) { + //uncomment below and update the code to test getOrderById + //instance.getOrderById(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('placeOrder', function() { + it('should call placeOrder successfully', function(done) { + //uncomment below and update the code to test placeOrder + //instance.placeOrder(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/UserApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/UserApi.spec.js new file mode 100644 index 00000000000..55c8967f13b --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/UserApi.spec.js @@ -0,0 +1,133 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.UserApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('UserApi', function() { + describe('createUser', function() { + it('should call createUser successfully', function(done) { + //uncomment below and update the code to test createUser + //instance.createUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('createUsersWithArrayInput', function() { + it('should call createUsersWithArrayInput successfully', function(done) { + //uncomment below and update the code to test createUsersWithArrayInput + //instance.createUsersWithArrayInput(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('createUsersWithListInput', function() { + it('should call createUsersWithListInput successfully', function(done) { + //uncomment below and update the code to test createUsersWithListInput + //instance.createUsersWithListInput(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteUser', function() { + it('should call deleteUser successfully', function(done) { + //uncomment below and update the code to test deleteUser + //instance.deleteUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getUserByName', function() { + it('should call getUserByName successfully', function(done) { + //uncomment below and update the code to test getUserByName + //instance.getUserByName(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('loginUser', function() { + it('should call loginUser successfully', function(done) { + //uncomment below and update the code to test loginUser + //instance.loginUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('logoutUser', function() { + it('should call logoutUser successfully', function(done) { + //uncomment below and update the code to test logoutUser + //instance.logoutUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updateUser', function() { + it('should call updateUser successfully', function(done) { + //uncomment below and update the code to test updateUser + //instance.updateUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/AdditionalPropertiesClass.spec.js b/samples/client/petstore/javascript-es6/src/test/model/AdditionalPropertiesClass.spec.js new file mode 100644 index 00000000000..887052c0109 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/AdditionalPropertiesClass.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AdditionalPropertiesClass(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AdditionalPropertiesClass', function() { + it('should create an instance of AdditionalPropertiesClass', function() { + // uncomment below and update the code to test AdditionalPropertiesClass + //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //expect(instance).to.be.a(SwaggerPetstore.AdditionalPropertiesClass); + }); + + it('should have the property mapProperty (base name: "map_property")', function() { + // uncomment below and update the code to test the property mapProperty + //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + it('should have the property mapOfMapProperty (base name: "map_of_map_property")', function() { + // uncomment below and update the code to test the property mapOfMapProperty + //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Animal.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Animal.spec.js new file mode 100644 index 00000000000..4270461cc5e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Animal.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Animal(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Animal', function() { + it('should create an instance of Animal', function() { + // uncomment below and update the code to test Animal + //var instane = new SwaggerPetstore.Animal(); + //expect(instance).to.be.a(SwaggerPetstore.Animal); + }); + + it('should have the property className (base name: "className")', function() { + // uncomment below and update the code to test the property className + //var instane = new SwaggerPetstore.Animal(); + //expect(instance).to.be(); + }); + + it('should have the property color (base name: "color")', function() { + // uncomment below and update the code to test the property color + //var instane = new SwaggerPetstore.Animal(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/AnimalFarm.spec.js b/samples/client/petstore/javascript-es6/src/test/model/AnimalFarm.spec.js new file mode 100644 index 00000000000..ffc54a3c381 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/AnimalFarm.spec.js @@ -0,0 +1,59 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnimalFarm(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnimalFarm', function() { + it('should create an instance of AnimalFarm', function() { + // uncomment below and update the code to test AnimalFarm + //var instane = new SwaggerPetstore.AnimalFarm(); + //expect(instance).to.be.a(SwaggerPetstore.AnimalFarm); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ApiResponse.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ApiResponse.spec.js new file mode 100644 index 00000000000..1070013e367 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ApiResponse.spec.js @@ -0,0 +1,77 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ApiResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ApiResponse', function() { + it('should create an instance of ApiResponse', function() { + // uncomment below and update the code to test ApiResponse + //var instane = new SwaggerPetstore.ApiResponse(); + //expect(instance).to.be.a(SwaggerPetstore.ApiResponse); + }); + + it('should have the property code (base name: "code")', function() { + // uncomment below and update the code to test the property code + //var instane = new SwaggerPetstore.ApiResponse(); + //expect(instance).to.be(); + }); + + it('should have the property type (base name: "type")', function() { + // uncomment below and update the code to test the property type + //var instane = new SwaggerPetstore.ApiResponse(); + //expect(instance).to.be(); + }); + + it('should have the property message (base name: "message")', function() { + // uncomment below and update the code to test the property message + //var instane = new SwaggerPetstore.ApiResponse(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ArrayOfArrayOfNumberOnly.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ArrayOfArrayOfNumberOnly.spec.js new file mode 100644 index 00000000000..9fcd218fbb3 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ArrayOfArrayOfNumberOnly.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ArrayOfArrayOfNumberOnly', function() { + it('should create an instance of ArrayOfArrayOfNumberOnly', function() { + // uncomment below and update the code to test ArrayOfArrayOfNumberOnly + //var instane = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + //expect(instance).to.be.a(SwaggerPetstore.ArrayOfArrayOfNumberOnly); + }); + + it('should have the property arrayArrayNumber (base name: "ArrayArrayNumber")', function() { + // uncomment below and update the code to test the property arrayArrayNumber + //var instane = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ArrayOfNumberOnly.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ArrayOfNumberOnly.spec.js new file mode 100644 index 00000000000..32d5f98586a --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ArrayOfNumberOnly.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ArrayOfNumberOnly(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ArrayOfNumberOnly', function() { + it('should create an instance of ArrayOfNumberOnly', function() { + // uncomment below and update the code to test ArrayOfNumberOnly + //var instane = new SwaggerPetstore.ArrayOfNumberOnly(); + //expect(instance).to.be.a(SwaggerPetstore.ArrayOfNumberOnly); + }); + + it('should have the property arrayNumber (base name: "ArrayNumber")', function() { + // uncomment below and update the code to test the property arrayNumber + //var instane = new SwaggerPetstore.ArrayOfNumberOnly(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ArrayTest.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ArrayTest.spec.js new file mode 100644 index 00000000000..1d93d897a9d --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ArrayTest.spec.js @@ -0,0 +1,77 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ArrayTest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ArrayTest', function() { + it('should create an instance of ArrayTest', function() { + // uncomment below and update the code to test ArrayTest + //var instane = new SwaggerPetstore.ArrayTest(); + //expect(instance).to.be.a(SwaggerPetstore.ArrayTest); + }); + + it('should have the property arrayOfString (base name: "array_of_string")', function() { + // uncomment below and update the code to test the property arrayOfString + //var instane = new SwaggerPetstore.ArrayTest(); + //expect(instance).to.be(); + }); + + it('should have the property arrayArrayOfInteger (base name: "array_array_of_integer")', function() { + // uncomment below and update the code to test the property arrayArrayOfInteger + //var instane = new SwaggerPetstore.ArrayTest(); + //expect(instance).to.be(); + }); + + it('should have the property arrayArrayOfModel (base name: "array_array_of_model")', function() { + // uncomment below and update the code to test the property arrayArrayOfModel + //var instane = new SwaggerPetstore.ArrayTest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Capitalization.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Capitalization.spec.js new file mode 100644 index 00000000000..f1aa695c3fd --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Capitalization.spec.js @@ -0,0 +1,95 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Capitalization(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Capitalization', function() { + it('should create an instance of Capitalization', function() { + // uncomment below and update the code to test Capitalization + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be.a(SwaggerPetstore.Capitalization); + }); + + it('should have the property smallCamel (base name: "smallCamel")', function() { + // uncomment below and update the code to test the property smallCamel + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property capitalCamel (base name: "CapitalCamel")', function() { + // uncomment below and update the code to test the property capitalCamel + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property smallSnake (base name: "small_Snake")', function() { + // uncomment below and update the code to test the property smallSnake + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property capitalSnake (base name: "Capital_Snake")', function() { + // uncomment below and update the code to test the property capitalSnake + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property sCAETHFlowPoints (base name: "SCA_ETH_Flow_Points")', function() { + // uncomment below and update the code to test the property sCAETHFlowPoints + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property ATT_NAME (base name: "ATT_NAME")', function() { + // uncomment below and update the code to test the property ATT_NAME + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Cat.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Cat.spec.js new file mode 100644 index 00000000000..f0d5476b268 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Cat.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Cat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Cat', function() { + it('should create an instance of Cat', function() { + // uncomment below and update the code to test Cat + //var instane = new SwaggerPetstore.Cat(); + //expect(instance).to.be.a(SwaggerPetstore.Cat); + }); + + it('should have the property declawed (base name: "declawed")', function() { + // uncomment below and update the code to test the property declawed + //var instane = new SwaggerPetstore.Cat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Category.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Category.spec.js new file mode 100644 index 00000000000..561eaf8373e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Category.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Category(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Category', function() { + it('should create an instance of Category', function() { + // uncomment below and update the code to test Category + //var instane = new SwaggerPetstore.Category(); + //expect(instance).to.be.a(SwaggerPetstore.Category); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.Category(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Category(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ClassModel.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ClassModel.spec.js new file mode 100644 index 00000000000..5ee2e49a0de --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ClassModel.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ClassModel(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ClassModel', function() { + it('should create an instance of ClassModel', function() { + // uncomment below and update the code to test ClassModel + //var instane = new SwaggerPetstore.ClassModel(); + //expect(instance).to.be.a(SwaggerPetstore.ClassModel); + }); + + it('should have the property _class (base name: "_class")', function() { + // uncomment below and update the code to test the property _class + //var instane = new SwaggerPetstore.ClassModel(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Client.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Client.spec.js new file mode 100644 index 00000000000..03af5ef730e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Client.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Client(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Client', function() { + it('should create an instance of Client', function() { + // uncomment below and update the code to test Client + //var instane = new SwaggerPetstore.Client(); + //expect(instance).to.be.a(SwaggerPetstore.Client); + }); + + it('should have the property client (base name: "client")', function() { + // uncomment below and update the code to test the property client + //var instane = new SwaggerPetstore.Client(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Dog.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Dog.spec.js new file mode 100644 index 00000000000..6421a501134 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Dog.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Dog(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Dog', function() { + it('should create an instance of Dog', function() { + // uncomment below and update the code to test Dog + //var instane = new SwaggerPetstore.Dog(); + //expect(instance).to.be.a(SwaggerPetstore.Dog); + }); + + it('should have the property breed (base name: "breed")', function() { + // uncomment below and update the code to test the property breed + //var instane = new SwaggerPetstore.Dog(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/EnumArrays.spec.js b/samples/client/petstore/javascript-es6/src/test/model/EnumArrays.spec.js new file mode 100644 index 00000000000..45c8d595bb6 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/EnumArrays.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.EnumArrays(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('EnumArrays', function() { + it('should create an instance of EnumArrays', function() { + // uncomment below and update the code to test EnumArrays + //var instane = new SwaggerPetstore.EnumArrays(); + //expect(instance).to.be.a(SwaggerPetstore.EnumArrays); + }); + + it('should have the property justSymbol (base name: "just_symbol")', function() { + // uncomment below and update the code to test the property justSymbol + //var instane = new SwaggerPetstore.EnumArrays(); + //expect(instance).to.be(); + }); + + it('should have the property arrayEnum (base name: "array_enum")', function() { + // uncomment below and update the code to test the property arrayEnum + //var instane = new SwaggerPetstore.EnumArrays(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/EnumClass.spec.js b/samples/client/petstore/javascript-es6/src/test/model/EnumClass.spec.js new file mode 100644 index 00000000000..2f60b4fc4a4 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/EnumClass.spec.js @@ -0,0 +1,58 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('EnumClass', function() { + it('should create an instance of EnumClass', function() { + // uncomment below and update the code to test EnumClass + //var instane = new SwaggerPetstore.EnumClass(); + //expect(instance).to.be.a(SwaggerPetstore.EnumClass); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/EnumTest.spec.js b/samples/client/petstore/javascript-es6/src/test/model/EnumTest.spec.js new file mode 100644 index 00000000000..1a08cba3d72 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/EnumTest.spec.js @@ -0,0 +1,83 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.EnumTest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('EnumTest', function() { + it('should create an instance of EnumTest', function() { + // uncomment below and update the code to test EnumTest + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be.a(SwaggerPetstore.EnumTest); + }); + + it('should have the property enumString (base name: "enum_string")', function() { + // uncomment below and update the code to test the property enumString + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + it('should have the property enumInteger (base name: "enum_integer")', function() { + // uncomment below and update the code to test the property enumInteger + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + it('should have the property enumNumber (base name: "enum_number")', function() { + // uncomment below and update the code to test the property enumNumber + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + it('should have the property outerEnum (base name: "outerEnum")', function() { + // uncomment below and update the code to test the property outerEnum + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/FormatTest.spec.js b/samples/client/petstore/javascript-es6/src/test/model/FormatTest.spec.js new file mode 100644 index 00000000000..74b0b80c74e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/FormatTest.spec.js @@ -0,0 +1,137 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FormatTest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FormatTest', function() { + it('should create an instance of FormatTest', function() { + // uncomment below and update the code to test FormatTest + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be.a(SwaggerPetstore.FormatTest); + }); + + it('should have the property integer (base name: "integer")', function() { + // uncomment below and update the code to test the property integer + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property int32 (base name: "int32")', function() { + // uncomment below and update the code to test the property int32 + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property int64 (base name: "int64")', function() { + // uncomment below and update the code to test the property int64 + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _number (base name: "number")', function() { + // uncomment below and update the code to test the property _number + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _float (base name: "float")', function() { + // uncomment below and update the code to test the property _float + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _double (base name: "double")', function() { + // uncomment below and update the code to test the property _double + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _string (base name: "string")', function() { + // uncomment below and update the code to test the property _string + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _byte (base name: "byte")', function() { + // uncomment below and update the code to test the property _byte + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property binary (base name: "binary")', function() { + // uncomment below and update the code to test the property binary + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _date (base name: "date")', function() { + // uncomment below and update the code to test the property _date + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property dateTime (base name: "dateTime")', function() { + // uncomment below and update the code to test the property dateTime + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property uuid (base name: "uuid")', function() { + // uncomment below and update the code to test the property uuid + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property password (base name: "password")', function() { + // uncomment below and update the code to test the property password + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/HasOnlyReadOnly.spec.js b/samples/client/petstore/javascript-es6/src/test/model/HasOnlyReadOnly.spec.js new file mode 100644 index 00000000000..ad4f4ba6d71 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/HasOnlyReadOnly.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.HasOnlyReadOnly(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('HasOnlyReadOnly', function() { + it('should create an instance of HasOnlyReadOnly', function() { + // uncomment below and update the code to test HasOnlyReadOnly + //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //expect(instance).to.be.a(SwaggerPetstore.HasOnlyReadOnly); + }); + + it('should have the property bar (base name: "bar")', function() { + // uncomment below and update the code to test the property bar + //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //expect(instance).to.be(); + }); + + it('should have the property foo (base name: "foo")', function() { + // uncomment below and update the code to test the property foo + //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/List.spec.js b/samples/client/petstore/javascript-es6/src/test/model/List.spec.js new file mode 100644 index 00000000000..7ea30e82fc8 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/List.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.List(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('List', function() { + it('should create an instance of List', function() { + // uncomment below and update the code to test List + //var instane = new SwaggerPetstore.List(); + //expect(instance).to.be.a(SwaggerPetstore.List); + }); + + it('should have the property _123List (base name: "123-list")', function() { + // uncomment below and update the code to test the property _123List + //var instane = new SwaggerPetstore.List(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/MapTest.spec.js b/samples/client/petstore/javascript-es6/src/test/model/MapTest.spec.js new file mode 100644 index 00000000000..1a67fcf7ae6 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/MapTest.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.MapTest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('MapTest', function() { + it('should create an instance of MapTest', function() { + // uncomment below and update the code to test MapTest + //var instane = new SwaggerPetstore.MapTest(); + //expect(instance).to.be.a(SwaggerPetstore.MapTest); + }); + + it('should have the property mapMapOfString (base name: "map_map_of_string")', function() { + // uncomment below and update the code to test the property mapMapOfString + //var instane = new SwaggerPetstore.MapTest(); + //expect(instance).to.be(); + }); + + it('should have the property mapOfEnumString (base name: "map_of_enum_string")', function() { + // uncomment below and update the code to test the property mapOfEnumString + //var instane = new SwaggerPetstore.MapTest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js b/samples/client/petstore/javascript-es6/src/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js new file mode 100644 index 00000000000..be493898584 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js @@ -0,0 +1,77 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('MixedPropertiesAndAdditionalPropertiesClass', function() { + it('should create an instance of MixedPropertiesAndAdditionalPropertiesClass', function() { + // uncomment below and update the code to test MixedPropertiesAndAdditionalPropertiesClass + //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be.a(SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass); + }); + + it('should have the property uuid (base name: "uuid")', function() { + // uncomment below and update the code to test the property uuid + //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + it('should have the property dateTime (base name: "dateTime")', function() { + // uncomment below and update the code to test the property dateTime + //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + it('should have the property map (base name: "map")', function() { + // uncomment below and update the code to test the property map + //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Model200Response.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Model200Response.spec.js new file mode 100644 index 00000000000..5c513a36e1a --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Model200Response.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Model200Response(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Model200Response', function() { + it('should create an instance of Model200Response', function() { + // uncomment below and update the code to test Model200Response + //var instane = new SwaggerPetstore.Model200Response(); + //expect(instance).to.be.a(SwaggerPetstore.Model200Response); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Model200Response(); + //expect(instance).to.be(); + }); + + it('should have the property _class (base name: "class")', function() { + // uncomment below and update the code to test the property _class + //var instane = new SwaggerPetstore.Model200Response(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ModelReturn.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ModelReturn.spec.js new file mode 100644 index 00000000000..62b5f6ba57d --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ModelReturn.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ModelReturn(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ModelReturn', function() { + it('should create an instance of ModelReturn', function() { + // uncomment below and update the code to test ModelReturn + //var instane = new SwaggerPetstore.ModelReturn(); + //expect(instance).to.be.a(SwaggerPetstore.ModelReturn); + }); + + it('should have the property _return (base name: "return")', function() { + // uncomment below and update the code to test the property _return + //var instane = new SwaggerPetstore.ModelReturn(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Name.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Name.spec.js new file mode 100644 index 00000000000..c9caf576bd0 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Name.spec.js @@ -0,0 +1,83 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Name(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Name', function() { + it('should create an instance of Name', function() { + // uncomment below and update the code to test Name + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be.a(SwaggerPetstore.Name); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be(); + }); + + it('should have the property snakeCase (base name: "snake_case")', function() { + // uncomment below and update the code to test the property snakeCase + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be(); + }); + + it('should have the property property (base name: "property")', function() { + // uncomment below and update the code to test the property property + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be(); + }); + + it('should have the property _123Number (base name: "123Number")', function() { + // uncomment below and update the code to test the property _123Number + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/NumberOnly.spec.js b/samples/client/petstore/javascript-es6/src/test/model/NumberOnly.spec.js new file mode 100644 index 00000000000..641c03b13a4 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/NumberOnly.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.NumberOnly(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('NumberOnly', function() { + it('should create an instance of NumberOnly', function() { + // uncomment below and update the code to test NumberOnly + //var instane = new SwaggerPetstore.NumberOnly(); + //expect(instance).to.be.a(SwaggerPetstore.NumberOnly); + }); + + it('should have the property justNumber (base name: "JustNumber")', function() { + // uncomment below and update the code to test the property justNumber + //var instane = new SwaggerPetstore.NumberOnly(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Order.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Order.spec.js new file mode 100644 index 00000000000..69527dc8fdb --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Order.spec.js @@ -0,0 +1,95 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Order(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Order', function() { + it('should create an instance of Order', function() { + // uncomment below and update the code to test Order + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be.a(SwaggerPetstore.Order); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property petId (base name: "petId")', function() { + // uncomment below and update the code to test the property petId + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property quantity (base name: "quantity")', function() { + // uncomment below and update the code to test the property quantity + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property shipDate (base name: "shipDate")', function() { + // uncomment below and update the code to test the property shipDate + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property complete (base name: "complete")', function() { + // uncomment below and update the code to test the property complete + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterBoolean.spec.js new file mode 100644 index 00000000000..765f758cd09 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterBoolean.spec.js @@ -0,0 +1,60 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + // OuterBoolean is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterBoolean(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterBoolean', function() { + it('should create an instance of OuterBoolean', function() { + // uncomment below and update the code to test OuterBoolean + //var instane = new SwaggerPetstore.OuterBoolean(); + //expect(instance).to.be.a(SwaggerPetstore.OuterBoolean); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterComposite.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterComposite.spec.js new file mode 100644 index 00000000000..6fd830b7c0e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterComposite.spec.js @@ -0,0 +1,77 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.OuterComposite(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterComposite', function() { + it('should create an instance of OuterComposite', function() { + // uncomment below and update the code to test OuterComposite + //var instane = new SwaggerPetstore.OuterComposite(); + //expect(instance).to.be.a(SwaggerPetstore.OuterComposite); + }); + + it('should have the property myNumber (base name: "my_number")', function() { + // uncomment below and update the code to test the property myNumber + //var instane = new SwaggerPetstore.OuterComposite(); + //expect(instance).to.be(); + }); + + it('should have the property myString (base name: "my_string")', function() { + // uncomment below and update the code to test the property myString + //var instane = new SwaggerPetstore.OuterComposite(); + //expect(instance).to.be(); + }); + + it('should have the property myBoolean (base name: "my_boolean")', function() { + // uncomment below and update the code to test the property myBoolean + //var instane = new SwaggerPetstore.OuterComposite(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterEnum.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterEnum.spec.js new file mode 100644 index 00000000000..14c26a3aef5 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterEnum.spec.js @@ -0,0 +1,58 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterEnum', function() { + it('should create an instance of OuterEnum', function() { + // uncomment below and update the code to test OuterEnum + //var instane = new SwaggerPetstore.OuterEnum(); + //expect(instance).to.be.a(SwaggerPetstore.OuterEnum); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterNumber.spec.js new file mode 100644 index 00000000000..2466fbe6dc9 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterNumber.spec.js @@ -0,0 +1,60 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + // OuterNumber is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterNumber(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterNumber', function() { + it('should create an instance of OuterNumber', function() { + // uncomment below and update the code to test OuterNumber + //var instane = new SwaggerPetstore.OuterNumber(); + //expect(instance).to.be.a(SwaggerPetstore.OuterNumber); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterString.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterString.spec.js new file mode 100644 index 00000000000..46d6c579bc9 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterString.spec.js @@ -0,0 +1,60 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + // OuterString is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterString(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterString', function() { + it('should create an instance of OuterString', function() { + // uncomment below and update the code to test OuterString + //var instane = new SwaggerPetstore.OuterString(); + //expect(instance).to.be.a(SwaggerPetstore.OuterString); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Pet.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Pet.spec.js new file mode 100644 index 00000000000..0da95d08662 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Pet.spec.js @@ -0,0 +1,95 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Pet(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Pet', function() { + it('should create an instance of Pet', function() { + // uncomment below and update the code to test Pet + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be.a(SwaggerPetstore.Pet); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property category (base name: "category")', function() { + // uncomment below and update the code to test the property category + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property photoUrls (base name: "photoUrls")', function() { + // uncomment below and update the code to test the property photoUrls + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property tags (base name: "tags")', function() { + // uncomment below and update the code to test the property tags + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ReadOnlyFirst.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ReadOnlyFirst.spec.js new file mode 100644 index 00000000000..375856a5abc --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ReadOnlyFirst.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ReadOnlyFirst(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ReadOnlyFirst', function() { + it('should create an instance of ReadOnlyFirst', function() { + // uncomment below and update the code to test ReadOnlyFirst + //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //expect(instance).to.be.a(SwaggerPetstore.ReadOnlyFirst); + }); + + it('should have the property bar (base name: "bar")', function() { + // uncomment below and update the code to test the property bar + //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //expect(instance).to.be(); + }); + + it('should have the property baz (base name: "baz")', function() { + // uncomment below and update the code to test the property baz + //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/SpecialModelName.spec.js b/samples/client/petstore/javascript-es6/src/test/model/SpecialModelName.spec.js new file mode 100644 index 00000000000..1d821d94f2a --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/SpecialModelName.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.SpecialModelName(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('SpecialModelName', function() { + it('should create an instance of SpecialModelName', function() { + // uncomment below and update the code to test SpecialModelName + //var instane = new SwaggerPetstore.SpecialModelName(); + //expect(instance).to.be.a(SwaggerPetstore.SpecialModelName); + }); + + it('should have the property specialPropertyName (base name: "$special[property.name]")', function() { + // uncomment below and update the code to test the property specialPropertyName + //var instane = new SwaggerPetstore.SpecialModelName(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Tag.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Tag.spec.js new file mode 100644 index 00000000000..b4aaf43538e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Tag.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Tag(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Tag', function() { + it('should create an instance of Tag', function() { + // uncomment below and update the code to test Tag + //var instane = new SwaggerPetstore.Tag(); + //expect(instance).to.be.a(SwaggerPetstore.Tag); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.Tag(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Tag(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/User.spec.js b/samples/client/petstore/javascript-es6/src/test/model/User.spec.js new file mode 100644 index 00000000000..19db8f90bfd --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/User.spec.js @@ -0,0 +1,107 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.User(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('User', function() { + it('should create an instance of User', function() { + // uncomment below and update the code to test User + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be.a(SwaggerPetstore.User); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property username (base name: "username")', function() { + // uncomment below and update the code to test the property username + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property firstName (base name: "firstName")', function() { + // uncomment below and update the code to test the property firstName + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property lastName (base name: "lastName")', function() { + // uncomment below and update the code to test the property lastName + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property email (base name: "email")', function() { + // uncomment below and update the code to test the property email + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property password (base name: "password")', function() { + // uncomment below and update the code to test the property password + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property phone (base name: "phone")', function() { + // uncomment below and update the code to test the property phone + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property userStatus (base name: "userStatus")', function() { + // uncomment below and update the code to test the property userStatus + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/test/ApiClientTest.js b/samples/client/petstore/javascript-es6/test/ApiClientTest.js new file mode 100644 index 00000000000..5e98b685a91 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js index f55538a53e7..75084078423 100644 --- a/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.AnotherFakeApi(); + instance = new OpenApiPetstore.AnotherFakeApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/api/FakeApi.spec.js b/samples/client/petstore/javascript-es6/test/api/FakeApi.spec.js index f2903d6612c..7931dbdd6c8 100644 --- a/samples/client/petstore/javascript-es6/test/api/FakeApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/FakeApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.FakeApi(); + instance = new OpenApiPetstore.FakeApi(); }); var getProperty = function(object, getter, property) { @@ -88,6 +88,16 @@ done(); }); }); + describe('testBodyWithQueryParams', function() { + it('should call testBodyWithQueryParams successfully', function(done) { + //uncomment below and update the code to test testBodyWithQueryParams + //instance.testBodyWithQueryParams(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); describe('testClientModel', function() { it('should call testClientModel successfully', function(done) { //uncomment below and update the code to test testClientModel @@ -118,6 +128,26 @@ done(); }); }); + describe('testInlineAdditionalProperties', function() { + it('should call testInlineAdditionalProperties successfully', function(done) { + //uncomment below and update the code to test testInlineAdditionalProperties + //instance.testInlineAdditionalProperties(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('testJsonFormData', function() { + it('should call testJsonFormData successfully', function(done) { + //uncomment below and update the code to test testJsonFormData + //instance.testJsonFormData(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); }); })); diff --git a/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js index 10e20e7778a..a9f0780a18f 100644 --- a/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.FakeClassnameTags123Api(); + instance = new OpenApiPetstore.FakeClassnameTags123Api(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/api/PetApi.spec.js b/samples/client/petstore/javascript-es6/test/api/PetApi.spec.js index 5259a2c6665..259dfabb3f0 100644 --- a/samples/client/petstore/javascript-es6/test/api/PetApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/PetApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.PetApi(); + instance = new OpenApiPetstore.PetApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/api/StoreApi.spec.js b/samples/client/petstore/javascript-es6/test/api/StoreApi.spec.js index d19da2f28d8..cd542e15f5d 100644 --- a/samples/client/petstore/javascript-es6/test/api/StoreApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/StoreApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.StoreApi(); + instance = new OpenApiPetstore.StoreApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/api/UserApi.spec.js b/samples/client/petstore/javascript-es6/test/api/UserApi.spec.js index 55c8967f13b..c5ba7e4e4bc 100644 --- a/samples/client/petstore/javascript-es6/test/api/UserApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/UserApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.UserApi(); + instance = new OpenApiPetstore.UserApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/model/AdditionalPropertiesClass.spec.js b/samples/client/petstore/javascript-es6/test/model/AdditionalPropertiesClass.spec.js index 887052c0109..4c472d5ac5f 100644 --- a/samples/client/petstore/javascript-es6/test/model/AdditionalPropertiesClass.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/AdditionalPropertiesClass.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.AdditionalPropertiesClass(); + instance = new OpenApiPetstore.AdditionalPropertiesClass(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('AdditionalPropertiesClass', function() { it('should create an instance of AdditionalPropertiesClass', function() { // uncomment below and update the code to test AdditionalPropertiesClass - //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); - //expect(instance).to.be.a(SwaggerPetstore.AdditionalPropertiesClass); + //var instane = new OpenApiPetstore.AdditionalPropertiesClass(); + //expect(instance).to.be.a(OpenApiPetstore.AdditionalPropertiesClass); }); it('should have the property mapProperty (base name: "map_property")', function() { // uncomment below and update the code to test the property mapProperty - //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.AdditionalPropertiesClass(); //expect(instance).to.be(); }); it('should have the property mapOfMapProperty (base name: "map_of_map_property")', function() { // uncomment below and update the code to test the property mapOfMapProperty - //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.AdditionalPropertiesClass(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Animal.spec.js b/samples/client/petstore/javascript-es6/test/model/Animal.spec.js index 4270461cc5e..dbe9ef41d14 100644 --- a/samples/client/petstore/javascript-es6/test/model/Animal.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Animal.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Animal(); + instance = new OpenApiPetstore.Animal(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('Animal', function() { it('should create an instance of Animal', function() { // uncomment below and update the code to test Animal - //var instane = new SwaggerPetstore.Animal(); - //expect(instance).to.be.a(SwaggerPetstore.Animal); + //var instane = new OpenApiPetstore.Animal(); + //expect(instance).to.be.a(OpenApiPetstore.Animal); }); it('should have the property className (base name: "className")', function() { // uncomment below and update the code to test the property className - //var instane = new SwaggerPetstore.Animal(); + //var instane = new OpenApiPetstore.Animal(); //expect(instance).to.be(); }); it('should have the property color (base name: "color")', function() { // uncomment below and update the code to test the property color - //var instane = new SwaggerPetstore.Animal(); + //var instane = new OpenApiPetstore.Animal(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/AnimalFarm.spec.js b/samples/client/petstore/javascript-es6/test/model/AnimalFarm.spec.js index ffc54a3c381..4c616e5e308 100644 --- a/samples/client/petstore/javascript-es6/test/model/AnimalFarm.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/AnimalFarm.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.AnimalFarm(); + instance = new OpenApiPetstore.AnimalFarm(); }); var getProperty = function(object, getter, property) { @@ -50,8 +50,8 @@ describe('AnimalFarm', function() { it('should create an instance of AnimalFarm', function() { // uncomment below and update the code to test AnimalFarm - //var instane = new SwaggerPetstore.AnimalFarm(); - //expect(instance).to.be.a(SwaggerPetstore.AnimalFarm); + //var instane = new OpenApiPetstore.AnimalFarm(); + //expect(instance).to.be.a(OpenApiPetstore.AnimalFarm); }); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ApiResponse.spec.js b/samples/client/petstore/javascript-es6/test/model/ApiResponse.spec.js index 1070013e367..1165094a73c 100644 --- a/samples/client/petstore/javascript-es6/test/model/ApiResponse.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ApiResponse.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ApiResponse(); + instance = new OpenApiPetstore.ApiResponse(); }); var getProperty = function(object, getter, property) { @@ -50,25 +50,25 @@ describe('ApiResponse', function() { it('should create an instance of ApiResponse', function() { // uncomment below and update the code to test ApiResponse - //var instane = new SwaggerPetstore.ApiResponse(); - //expect(instance).to.be.a(SwaggerPetstore.ApiResponse); + //var instane = new OpenApiPetstore.ApiResponse(); + //expect(instance).to.be.a(OpenApiPetstore.ApiResponse); }); it('should have the property code (base name: "code")', function() { // uncomment below and update the code to test the property code - //var instane = new SwaggerPetstore.ApiResponse(); + //var instane = new OpenApiPetstore.ApiResponse(); //expect(instance).to.be(); }); it('should have the property type (base name: "type")', function() { // uncomment below and update the code to test the property type - //var instane = new SwaggerPetstore.ApiResponse(); + //var instane = new OpenApiPetstore.ApiResponse(); //expect(instance).to.be(); }); it('should have the property message (base name: "message")', function() { // uncomment below and update the code to test the property message - //var instane = new SwaggerPetstore.ApiResponse(); + //var instane = new OpenApiPetstore.ApiResponse(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ArrayOfArrayOfNumberOnly.spec.js b/samples/client/petstore/javascript-es6/test/model/ArrayOfArrayOfNumberOnly.spec.js index 9fcd218fbb3..f30c53f5ed6 100644 --- a/samples/client/petstore/javascript-es6/test/model/ArrayOfArrayOfNumberOnly.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ArrayOfArrayOfNumberOnly.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + instance = new OpenApiPetstore.ArrayOfArrayOfNumberOnly(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('ArrayOfArrayOfNumberOnly', function() { it('should create an instance of ArrayOfArrayOfNumberOnly', function() { // uncomment below and update the code to test ArrayOfArrayOfNumberOnly - //var instane = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); - //expect(instance).to.be.a(SwaggerPetstore.ArrayOfArrayOfNumberOnly); + //var instane = new OpenApiPetstore.ArrayOfArrayOfNumberOnly(); + //expect(instance).to.be.a(OpenApiPetstore.ArrayOfArrayOfNumberOnly); }); it('should have the property arrayArrayNumber (base name: "ArrayArrayNumber")', function() { // uncomment below and update the code to test the property arrayArrayNumber - //var instane = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + //var instane = new OpenApiPetstore.ArrayOfArrayOfNumberOnly(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ArrayOfNumberOnly.spec.js b/samples/client/petstore/javascript-es6/test/model/ArrayOfNumberOnly.spec.js index 32d5f98586a..6c2bc8807d9 100644 --- a/samples/client/petstore/javascript-es6/test/model/ArrayOfNumberOnly.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ArrayOfNumberOnly.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ArrayOfNumberOnly(); + instance = new OpenApiPetstore.ArrayOfNumberOnly(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('ArrayOfNumberOnly', function() { it('should create an instance of ArrayOfNumberOnly', function() { // uncomment below and update the code to test ArrayOfNumberOnly - //var instane = new SwaggerPetstore.ArrayOfNumberOnly(); - //expect(instance).to.be.a(SwaggerPetstore.ArrayOfNumberOnly); + //var instane = new OpenApiPetstore.ArrayOfNumberOnly(); + //expect(instance).to.be.a(OpenApiPetstore.ArrayOfNumberOnly); }); it('should have the property arrayNumber (base name: "ArrayNumber")', function() { // uncomment below and update the code to test the property arrayNumber - //var instane = new SwaggerPetstore.ArrayOfNumberOnly(); + //var instane = new OpenApiPetstore.ArrayOfNumberOnly(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ArrayTest.spec.js b/samples/client/petstore/javascript-es6/test/model/ArrayTest.spec.js index 1d93d897a9d..ab9294b159c 100644 --- a/samples/client/petstore/javascript-es6/test/model/ArrayTest.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ArrayTest.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ArrayTest(); + instance = new OpenApiPetstore.ArrayTest(); }); var getProperty = function(object, getter, property) { @@ -50,25 +50,25 @@ describe('ArrayTest', function() { it('should create an instance of ArrayTest', function() { // uncomment below and update the code to test ArrayTest - //var instane = new SwaggerPetstore.ArrayTest(); - //expect(instance).to.be.a(SwaggerPetstore.ArrayTest); + //var instane = new OpenApiPetstore.ArrayTest(); + //expect(instance).to.be.a(OpenApiPetstore.ArrayTest); }); it('should have the property arrayOfString (base name: "array_of_string")', function() { // uncomment below and update the code to test the property arrayOfString - //var instane = new SwaggerPetstore.ArrayTest(); + //var instane = new OpenApiPetstore.ArrayTest(); //expect(instance).to.be(); }); it('should have the property arrayArrayOfInteger (base name: "array_array_of_integer")', function() { // uncomment below and update the code to test the property arrayArrayOfInteger - //var instane = new SwaggerPetstore.ArrayTest(); + //var instane = new OpenApiPetstore.ArrayTest(); //expect(instance).to.be(); }); it('should have the property arrayArrayOfModel (base name: "array_array_of_model")', function() { // uncomment below and update the code to test the property arrayArrayOfModel - //var instane = new SwaggerPetstore.ArrayTest(); + //var instane = new OpenApiPetstore.ArrayTest(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Capitalization.spec.js b/samples/client/petstore/javascript-es6/test/model/Capitalization.spec.js index f1aa695c3fd..8be47e3e132 100644 --- a/samples/client/petstore/javascript-es6/test/model/Capitalization.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Capitalization.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Capitalization(); + instance = new OpenApiPetstore.Capitalization(); }); var getProperty = function(object, getter, property) { @@ -50,43 +50,43 @@ describe('Capitalization', function() { it('should create an instance of Capitalization', function() { // uncomment below and update the code to test Capitalization - //var instane = new SwaggerPetstore.Capitalization(); - //expect(instance).to.be.a(SwaggerPetstore.Capitalization); + //var instane = new OpenApiPetstore.Capitalization(); + //expect(instance).to.be.a(OpenApiPetstore.Capitalization); }); it('should have the property smallCamel (base name: "smallCamel")', function() { // uncomment below and update the code to test the property smallCamel - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property capitalCamel (base name: "CapitalCamel")', function() { // uncomment below and update the code to test the property capitalCamel - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property smallSnake (base name: "small_Snake")', function() { // uncomment below and update the code to test the property smallSnake - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property capitalSnake (base name: "Capital_Snake")', function() { // uncomment below and update the code to test the property capitalSnake - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property sCAETHFlowPoints (base name: "SCA_ETH_Flow_Points")', function() { // uncomment below and update the code to test the property sCAETHFlowPoints - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property ATT_NAME (base name: "ATT_NAME")', function() { // uncomment below and update the code to test the property ATT_NAME - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Cat.spec.js b/samples/client/petstore/javascript-es6/test/model/Cat.spec.js index f0d5476b268..99b7496450d 100644 --- a/samples/client/petstore/javascript-es6/test/model/Cat.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Cat.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Cat(); + instance = new OpenApiPetstore.Cat(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('Cat', function() { it('should create an instance of Cat', function() { // uncomment below and update the code to test Cat - //var instane = new SwaggerPetstore.Cat(); - //expect(instance).to.be.a(SwaggerPetstore.Cat); + //var instane = new OpenApiPetstore.Cat(); + //expect(instance).to.be.a(OpenApiPetstore.Cat); }); it('should have the property declawed (base name: "declawed")', function() { // uncomment below and update the code to test the property declawed - //var instane = new SwaggerPetstore.Cat(); + //var instane = new OpenApiPetstore.Cat(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Category.spec.js b/samples/client/petstore/javascript-es6/test/model/Category.spec.js index 561eaf8373e..2a02a9e4708 100644 --- a/samples/client/petstore/javascript-es6/test/model/Category.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Category.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Category(); + instance = new OpenApiPetstore.Category(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('Category', function() { it('should create an instance of Category', function() { // uncomment below and update the code to test Category - //var instane = new SwaggerPetstore.Category(); - //expect(instance).to.be.a(SwaggerPetstore.Category); + //var instane = new OpenApiPetstore.Category(); + //expect(instance).to.be.a(OpenApiPetstore.Category); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.Category(); + //var instane = new OpenApiPetstore.Category(); //expect(instance).to.be(); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Category(); + //var instane = new OpenApiPetstore.Category(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ClassModel.spec.js b/samples/client/petstore/javascript-es6/test/model/ClassModel.spec.js index 5ee2e49a0de..d87a995d19b 100644 --- a/samples/client/petstore/javascript-es6/test/model/ClassModel.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ClassModel.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ClassModel(); + instance = new OpenApiPetstore.ClassModel(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('ClassModel', function() { it('should create an instance of ClassModel', function() { // uncomment below and update the code to test ClassModel - //var instane = new SwaggerPetstore.ClassModel(); - //expect(instance).to.be.a(SwaggerPetstore.ClassModel); + //var instane = new OpenApiPetstore.ClassModel(); + //expect(instance).to.be.a(OpenApiPetstore.ClassModel); }); it('should have the property _class (base name: "_class")', function() { // uncomment below and update the code to test the property _class - //var instane = new SwaggerPetstore.ClassModel(); + //var instane = new OpenApiPetstore.ClassModel(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Client.spec.js b/samples/client/petstore/javascript-es6/test/model/Client.spec.js index 03af5ef730e..182ad624434 100644 --- a/samples/client/petstore/javascript-es6/test/model/Client.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Client.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Client(); + instance = new OpenApiPetstore.Client(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('Client', function() { it('should create an instance of Client', function() { // uncomment below and update the code to test Client - //var instane = new SwaggerPetstore.Client(); - //expect(instance).to.be.a(SwaggerPetstore.Client); + //var instane = new OpenApiPetstore.Client(); + //expect(instance).to.be.a(OpenApiPetstore.Client); }); it('should have the property client (base name: "client")', function() { // uncomment below and update the code to test the property client - //var instane = new SwaggerPetstore.Client(); + //var instane = new OpenApiPetstore.Client(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Dog.spec.js b/samples/client/petstore/javascript-es6/test/model/Dog.spec.js index 6421a501134..13d1584d01a 100644 --- a/samples/client/petstore/javascript-es6/test/model/Dog.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Dog.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Dog(); + instance = new OpenApiPetstore.Dog(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('Dog', function() { it('should create an instance of Dog', function() { // uncomment below and update the code to test Dog - //var instane = new SwaggerPetstore.Dog(); - //expect(instance).to.be.a(SwaggerPetstore.Dog); + //var instane = new OpenApiPetstore.Dog(); + //expect(instance).to.be.a(OpenApiPetstore.Dog); }); it('should have the property breed (base name: "breed")', function() { // uncomment below and update the code to test the property breed - //var instane = new SwaggerPetstore.Dog(); + //var instane = new OpenApiPetstore.Dog(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/EnumArrays.spec.js b/samples/client/petstore/javascript-es6/test/model/EnumArrays.spec.js index 45c8d595bb6..dae8d83d7f2 100644 --- a/samples/client/petstore/javascript-es6/test/model/EnumArrays.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/EnumArrays.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.EnumArrays(); + instance = new OpenApiPetstore.EnumArrays(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('EnumArrays', function() { it('should create an instance of EnumArrays', function() { // uncomment below and update the code to test EnumArrays - //var instane = new SwaggerPetstore.EnumArrays(); - //expect(instance).to.be.a(SwaggerPetstore.EnumArrays); + //var instane = new OpenApiPetstore.EnumArrays(); + //expect(instance).to.be.a(OpenApiPetstore.EnumArrays); }); it('should have the property justSymbol (base name: "just_symbol")', function() { // uncomment below and update the code to test the property justSymbol - //var instane = new SwaggerPetstore.EnumArrays(); + //var instane = new OpenApiPetstore.EnumArrays(); //expect(instance).to.be(); }); it('should have the property arrayEnum (base name: "array_enum")', function() { // uncomment below and update the code to test the property arrayEnum - //var instane = new SwaggerPetstore.EnumArrays(); + //var instane = new OpenApiPetstore.EnumArrays(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/EnumClass.spec.js b/samples/client/petstore/javascript-es6/test/model/EnumClass.spec.js index 2f60b4fc4a4..eb5a1117918 100644 --- a/samples/client/petstore/javascript-es6/test/model/EnumClass.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/EnumClass.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,9 +20,9 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; @@ -49,8 +49,8 @@ describe('EnumClass', function() { it('should create an instance of EnumClass', function() { // uncomment below and update the code to test EnumClass - //var instane = new SwaggerPetstore.EnumClass(); - //expect(instance).to.be.a(SwaggerPetstore.EnumClass); + //var instane = new OpenApiPetstore.EnumClass(); + //expect(instance).to.be.a(OpenApiPetstore.EnumClass); }); }); diff --git a/samples/client/petstore/javascript-es6/test/model/EnumTest.spec.js b/samples/client/petstore/javascript-es6/test/model/EnumTest.spec.js index 1a08cba3d72..6d7c2519e68 100644 --- a/samples/client/petstore/javascript-es6/test/model/EnumTest.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/EnumTest.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.EnumTest(); + instance = new OpenApiPetstore.EnumTest(); }); var getProperty = function(object, getter, property) { @@ -50,31 +50,37 @@ describe('EnumTest', function() { it('should create an instance of EnumTest', function() { // uncomment below and update the code to test EnumTest - //var instane = new SwaggerPetstore.EnumTest(); - //expect(instance).to.be.a(SwaggerPetstore.EnumTest); + //var instane = new OpenApiPetstore.EnumTest(); + //expect(instance).to.be.a(OpenApiPetstore.EnumTest); }); it('should have the property enumString (base name: "enum_string")', function() { // uncomment below and update the code to test the property enumString - //var instane = new SwaggerPetstore.EnumTest(); + //var instane = new OpenApiPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + it('should have the property enumStringRequired (base name: "enum_string_required")', function() { + // uncomment below and update the code to test the property enumStringRequired + //var instane = new OpenApiPetstore.EnumTest(); //expect(instance).to.be(); }); it('should have the property enumInteger (base name: "enum_integer")', function() { // uncomment below and update the code to test the property enumInteger - //var instane = new SwaggerPetstore.EnumTest(); + //var instane = new OpenApiPetstore.EnumTest(); //expect(instance).to.be(); }); it('should have the property enumNumber (base name: "enum_number")', function() { // uncomment below and update the code to test the property enumNumber - //var instane = new SwaggerPetstore.EnumTest(); + //var instane = new OpenApiPetstore.EnumTest(); //expect(instance).to.be(); }); it('should have the property outerEnum (base name: "outerEnum")', function() { // uncomment below and update the code to test the property outerEnum - //var instane = new SwaggerPetstore.EnumTest(); + //var instane = new OpenApiPetstore.EnumTest(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/FormatTest.spec.js b/samples/client/petstore/javascript-es6/test/model/FormatTest.spec.js index 74b0b80c74e..2e61e4f8ed9 100644 --- a/samples/client/petstore/javascript-es6/test/model/FormatTest.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/FormatTest.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.FormatTest(); + instance = new OpenApiPetstore.FormatTest(); }); var getProperty = function(object, getter, property) { @@ -50,85 +50,85 @@ describe('FormatTest', function() { it('should create an instance of FormatTest', function() { // uncomment below and update the code to test FormatTest - //var instane = new SwaggerPetstore.FormatTest(); - //expect(instance).to.be.a(SwaggerPetstore.FormatTest); + //var instane = new OpenApiPetstore.FormatTest(); + //expect(instance).to.be.a(OpenApiPetstore.FormatTest); }); it('should have the property integer (base name: "integer")', function() { // uncomment below and update the code to test the property integer - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property int32 (base name: "int32")', function() { // uncomment below and update the code to test the property int32 - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property int64 (base name: "int64")', function() { // uncomment below and update the code to test the property int64 - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _number (base name: "number")', function() { // uncomment below and update the code to test the property _number - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _float (base name: "float")', function() { // uncomment below and update the code to test the property _float - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _double (base name: "double")', function() { // uncomment below and update the code to test the property _double - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _string (base name: "string")', function() { // uncomment below and update the code to test the property _string - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _byte (base name: "byte")', function() { // uncomment below and update the code to test the property _byte - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property binary (base name: "binary")', function() { // uncomment below and update the code to test the property binary - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _date (base name: "date")', function() { // uncomment below and update the code to test the property _date - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property dateTime (base name: "dateTime")', function() { // uncomment below and update the code to test the property dateTime - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property uuid (base name: "uuid")', function() { // uncomment below and update the code to test the property uuid - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property password (base name: "password")', function() { // uncomment below and update the code to test the property password - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/HasOnlyReadOnly.spec.js b/samples/client/petstore/javascript-es6/test/model/HasOnlyReadOnly.spec.js index ad4f4ba6d71..409e06ad823 100644 --- a/samples/client/petstore/javascript-es6/test/model/HasOnlyReadOnly.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/HasOnlyReadOnly.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.HasOnlyReadOnly(); + instance = new OpenApiPetstore.HasOnlyReadOnly(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('HasOnlyReadOnly', function() { it('should create an instance of HasOnlyReadOnly', function() { // uncomment below and update the code to test HasOnlyReadOnly - //var instane = new SwaggerPetstore.HasOnlyReadOnly(); - //expect(instance).to.be.a(SwaggerPetstore.HasOnlyReadOnly); + //var instane = new OpenApiPetstore.HasOnlyReadOnly(); + //expect(instance).to.be.a(OpenApiPetstore.HasOnlyReadOnly); }); it('should have the property bar (base name: "bar")', function() { // uncomment below and update the code to test the property bar - //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //var instane = new OpenApiPetstore.HasOnlyReadOnly(); //expect(instance).to.be(); }); it('should have the property foo (base name: "foo")', function() { // uncomment below and update the code to test the property foo - //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //var instane = new OpenApiPetstore.HasOnlyReadOnly(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/List.spec.js b/samples/client/petstore/javascript-es6/test/model/List.spec.js index 7ea30e82fc8..e3a8574d9ae 100644 --- a/samples/client/petstore/javascript-es6/test/model/List.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/List.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.List(); + instance = new OpenApiPetstore.List(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('List', function() { it('should create an instance of List', function() { // uncomment below and update the code to test List - //var instane = new SwaggerPetstore.List(); - //expect(instance).to.be.a(SwaggerPetstore.List); + //var instane = new OpenApiPetstore.List(); + //expect(instance).to.be.a(OpenApiPetstore.List); }); - it('should have the property _123List (base name: "123-list")', function() { - // uncomment below and update the code to test the property _123List - //var instane = new SwaggerPetstore.List(); + it('should have the property _123list (base name: "123-list")', function() { + // uncomment below and update the code to test the property _123list + //var instane = new OpenApiPetstore.List(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/MapTest.spec.js b/samples/client/petstore/javascript-es6/test/model/MapTest.spec.js index 1a67fcf7ae6..da009beec4e 100644 --- a/samples/client/petstore/javascript-es6/test/model/MapTest.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/MapTest.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.MapTest(); + instance = new OpenApiPetstore.MapTest(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('MapTest', function() { it('should create an instance of MapTest', function() { // uncomment below and update the code to test MapTest - //var instane = new SwaggerPetstore.MapTest(); - //expect(instance).to.be.a(SwaggerPetstore.MapTest); + //var instane = new OpenApiPetstore.MapTest(); + //expect(instance).to.be.a(OpenApiPetstore.MapTest); }); it('should have the property mapMapOfString (base name: "map_map_of_string")', function() { // uncomment below and update the code to test the property mapMapOfString - //var instane = new SwaggerPetstore.MapTest(); + //var instane = new OpenApiPetstore.MapTest(); //expect(instance).to.be(); }); it('should have the property mapOfEnumString (base name: "map_of_enum_string")', function() { // uncomment below and update the code to test the property mapOfEnumString - //var instane = new SwaggerPetstore.MapTest(); + //var instane = new OpenApiPetstore.MapTest(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js b/samples/client/petstore/javascript-es6/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js index be493898584..c9174f56154 100644 --- a/samples/client/petstore/javascript-es6/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + instance = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); }); var getProperty = function(object, getter, property) { @@ -50,25 +50,25 @@ describe('MixedPropertiesAndAdditionalPropertiesClass', function() { it('should create an instance of MixedPropertiesAndAdditionalPropertiesClass', function() { // uncomment below and update the code to test MixedPropertiesAndAdditionalPropertiesClass - //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); - //expect(instance).to.be.a(SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass); + //var instane = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be.a(OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass); }); it('should have the property uuid (base name: "uuid")', function() { // uncomment below and update the code to test the property uuid - //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); //expect(instance).to.be(); }); it('should have the property dateTime (base name: "dateTime")', function() { // uncomment below and update the code to test the property dateTime - //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); //expect(instance).to.be(); }); it('should have the property map (base name: "map")', function() { // uncomment below and update the code to test the property map - //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Model200Response.spec.js b/samples/client/petstore/javascript-es6/test/model/Model200Response.spec.js index 5c513a36e1a..13f768e9730 100644 --- a/samples/client/petstore/javascript-es6/test/model/Model200Response.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Model200Response.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Model200Response(); + instance = new OpenApiPetstore.Model200Response(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('Model200Response', function() { it('should create an instance of Model200Response', function() { // uncomment below and update the code to test Model200Response - //var instane = new SwaggerPetstore.Model200Response(); - //expect(instance).to.be.a(SwaggerPetstore.Model200Response); + //var instane = new OpenApiPetstore.Model200Response(); + //expect(instance).to.be.a(OpenApiPetstore.Model200Response); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Model200Response(); + //var instane = new OpenApiPetstore.Model200Response(); //expect(instance).to.be(); }); it('should have the property _class (base name: "class")', function() { // uncomment below and update the code to test the property _class - //var instane = new SwaggerPetstore.Model200Response(); + //var instane = new OpenApiPetstore.Model200Response(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ModelReturn.spec.js b/samples/client/petstore/javascript-es6/test/model/ModelReturn.spec.js index 62b5f6ba57d..bda09c52366 100644 --- a/samples/client/petstore/javascript-es6/test/model/ModelReturn.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ModelReturn.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ModelReturn(); + instance = new OpenApiPetstore.ModelReturn(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('ModelReturn', function() { it('should create an instance of ModelReturn', function() { // uncomment below and update the code to test ModelReturn - //var instane = new SwaggerPetstore.ModelReturn(); - //expect(instance).to.be.a(SwaggerPetstore.ModelReturn); + //var instane = new OpenApiPetstore.ModelReturn(); + //expect(instance).to.be.a(OpenApiPetstore.ModelReturn); }); it('should have the property _return (base name: "return")', function() { // uncomment below and update the code to test the property _return - //var instane = new SwaggerPetstore.ModelReturn(); + //var instane = new OpenApiPetstore.ModelReturn(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Name.spec.js b/samples/client/petstore/javascript-es6/test/model/Name.spec.js index c9caf576bd0..3726b8867b4 100644 --- a/samples/client/petstore/javascript-es6/test/model/Name.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Name.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Name(); + instance = new OpenApiPetstore.Name(); }); var getProperty = function(object, getter, property) { @@ -50,31 +50,31 @@ describe('Name', function() { it('should create an instance of Name', function() { // uncomment below and update the code to test Name - //var instane = new SwaggerPetstore.Name(); - //expect(instance).to.be.a(SwaggerPetstore.Name); + //var instane = new OpenApiPetstore.Name(); + //expect(instance).to.be.a(OpenApiPetstore.Name); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Name(); + //var instane = new OpenApiPetstore.Name(); //expect(instance).to.be(); }); it('should have the property snakeCase (base name: "snake_case")', function() { // uncomment below and update the code to test the property snakeCase - //var instane = new SwaggerPetstore.Name(); + //var instane = new OpenApiPetstore.Name(); //expect(instance).to.be(); }); it('should have the property property (base name: "property")', function() { // uncomment below and update the code to test the property property - //var instane = new SwaggerPetstore.Name(); + //var instane = new OpenApiPetstore.Name(); //expect(instance).to.be(); }); - it('should have the property _123Number (base name: "123Number")', function() { - // uncomment below and update the code to test the property _123Number - //var instane = new SwaggerPetstore.Name(); + it('should have the property _123number (base name: "123Number")', function() { + // uncomment below and update the code to test the property _123number + //var instane = new OpenApiPetstore.Name(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/NumberOnly.spec.js b/samples/client/petstore/javascript-es6/test/model/NumberOnly.spec.js index 641c03b13a4..2261973c9af 100644 --- a/samples/client/petstore/javascript-es6/test/model/NumberOnly.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/NumberOnly.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.NumberOnly(); + instance = new OpenApiPetstore.NumberOnly(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('NumberOnly', function() { it('should create an instance of NumberOnly', function() { // uncomment below and update the code to test NumberOnly - //var instane = new SwaggerPetstore.NumberOnly(); - //expect(instance).to.be.a(SwaggerPetstore.NumberOnly); + //var instane = new OpenApiPetstore.NumberOnly(); + //expect(instance).to.be.a(OpenApiPetstore.NumberOnly); }); it('should have the property justNumber (base name: "JustNumber")', function() { // uncomment below and update the code to test the property justNumber - //var instane = new SwaggerPetstore.NumberOnly(); + //var instane = new OpenApiPetstore.NumberOnly(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Order.spec.js b/samples/client/petstore/javascript-es6/test/model/Order.spec.js index 69527dc8fdb..536d217cc5b 100644 --- a/samples/client/petstore/javascript-es6/test/model/Order.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Order.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Order(); + instance = new OpenApiPetstore.Order(); }); var getProperty = function(object, getter, property) { @@ -50,43 +50,43 @@ describe('Order', function() { it('should create an instance of Order', function() { // uncomment below and update the code to test Order - //var instane = new SwaggerPetstore.Order(); - //expect(instance).to.be.a(SwaggerPetstore.Order); + //var instane = new OpenApiPetstore.Order(); + //expect(instance).to.be.a(OpenApiPetstore.Order); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property petId (base name: "petId")', function() { // uncomment below and update the code to test the property petId - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property quantity (base name: "quantity")', function() { // uncomment below and update the code to test the property quantity - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property shipDate (base name: "shipDate")', function() { // uncomment below and update the code to test the property shipDate - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property status (base name: "status")', function() { // uncomment below and update the code to test the property status - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property complete (base name: "complete")', function() { // uncomment below and update the code to test the property complete - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterBoolean.spec.js index d5495a638d8..765f758cd09 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterBoolean.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterBoolean.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterBoolean(); + // OuterBoolean is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterBoolean(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/model/OuterComposite.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterComposite.spec.js index 6fd830b7c0e..3309d619422 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterComposite.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterComposite.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterComposite(); + instance = new OpenApiPetstore.OuterComposite(); }); var getProperty = function(object, getter, property) { @@ -50,25 +50,25 @@ describe('OuterComposite', function() { it('should create an instance of OuterComposite', function() { // uncomment below and update the code to test OuterComposite - //var instane = new SwaggerPetstore.OuterComposite(); - //expect(instance).to.be.a(SwaggerPetstore.OuterComposite); + //var instane = new OpenApiPetstore.OuterComposite(); + //expect(instance).to.be.a(OpenApiPetstore.OuterComposite); }); it('should have the property myNumber (base name: "my_number")', function() { // uncomment below and update the code to test the property myNumber - //var instane = new SwaggerPetstore.OuterComposite(); + //var instane = new OpenApiPetstore.OuterComposite(); //expect(instance).to.be(); }); it('should have the property myString (base name: "my_string")', function() { // uncomment below and update the code to test the property myString - //var instane = new SwaggerPetstore.OuterComposite(); + //var instane = new OpenApiPetstore.OuterComposite(); //expect(instance).to.be(); }); it('should have the property myBoolean (base name: "my_boolean")', function() { // uncomment below and update the code to test the property myBoolean - //var instane = new SwaggerPetstore.OuterComposite(); + //var instane = new OpenApiPetstore.OuterComposite(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/OuterEnum.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterEnum.spec.js index 14c26a3aef5..fa51fa90cb4 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterEnum.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterEnum.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,9 +20,9 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; @@ -49,8 +49,8 @@ describe('OuterEnum', function() { it('should create an instance of OuterEnum', function() { // uncomment below and update the code to test OuterEnum - //var instane = new SwaggerPetstore.OuterEnum(); - //expect(instance).to.be.a(SwaggerPetstore.OuterEnum); + //var instane = new OpenApiPetstore.OuterEnum(); + //expect(instance).to.be.a(OpenApiPetstore.OuterEnum); }); }); diff --git a/samples/client/petstore/javascript-es6/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterNumber.spec.js index 7b0e4ebf119..2466fbe6dc9 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterNumber.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterNumber.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterNumber(); + // OuterNumber is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterNumber(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/model/OuterString.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterString.spec.js index 4e7f99ca88d..46d6c579bc9 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterString.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterString.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterString(); + // OuterString is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterString(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/model/Pet.spec.js b/samples/client/petstore/javascript-es6/test/model/Pet.spec.js index 0da95d08662..f8ce9b93a3c 100644 --- a/samples/client/petstore/javascript-es6/test/model/Pet.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Pet.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Pet(); + instance = new OpenApiPetstore.Pet(); }); var getProperty = function(object, getter, property) { @@ -50,43 +50,43 @@ describe('Pet', function() { it('should create an instance of Pet', function() { // uncomment below and update the code to test Pet - //var instane = new SwaggerPetstore.Pet(); - //expect(instance).to.be.a(SwaggerPetstore.Pet); + //var instane = new OpenApiPetstore.Pet(); + //expect(instance).to.be.a(OpenApiPetstore.Pet); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property category (base name: "category")', function() { // uncomment below and update the code to test the property category - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property photoUrls (base name: "photoUrls")', function() { // uncomment below and update the code to test the property photoUrls - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property tags (base name: "tags")', function() { // uncomment below and update the code to test the property tags - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property status (base name: "status")', function() { // uncomment below and update the code to test the property status - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ReadOnlyFirst.spec.js b/samples/client/petstore/javascript-es6/test/model/ReadOnlyFirst.spec.js index 375856a5abc..5bc5cb3a700 100644 --- a/samples/client/petstore/javascript-es6/test/model/ReadOnlyFirst.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ReadOnlyFirst.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ReadOnlyFirst(); + instance = new OpenApiPetstore.ReadOnlyFirst(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('ReadOnlyFirst', function() { it('should create an instance of ReadOnlyFirst', function() { // uncomment below and update the code to test ReadOnlyFirst - //var instane = new SwaggerPetstore.ReadOnlyFirst(); - //expect(instance).to.be.a(SwaggerPetstore.ReadOnlyFirst); + //var instane = new OpenApiPetstore.ReadOnlyFirst(); + //expect(instance).to.be.a(OpenApiPetstore.ReadOnlyFirst); }); it('should have the property bar (base name: "bar")', function() { // uncomment below and update the code to test the property bar - //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //var instane = new OpenApiPetstore.ReadOnlyFirst(); //expect(instance).to.be(); }); it('should have the property baz (base name: "baz")', function() { // uncomment below and update the code to test the property baz - //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //var instane = new OpenApiPetstore.ReadOnlyFirst(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/SpecialModelName.spec.js b/samples/client/petstore/javascript-es6/test/model/SpecialModelName.spec.js index 1d821d94f2a..f459d2e0cd6 100644 --- a/samples/client/petstore/javascript-es6/test/model/SpecialModelName.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/SpecialModelName.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.SpecialModelName(); + instance = new OpenApiPetstore.SpecialModelName(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('SpecialModelName', function() { it('should create an instance of SpecialModelName', function() { // uncomment below and update the code to test SpecialModelName - //var instane = new SwaggerPetstore.SpecialModelName(); - //expect(instance).to.be.a(SwaggerPetstore.SpecialModelName); + //var instane = new OpenApiPetstore.SpecialModelName(); + //expect(instance).to.be.a(OpenApiPetstore.SpecialModelName); }); it('should have the property specialPropertyName (base name: "$special[property.name]")', function() { // uncomment below and update the code to test the property specialPropertyName - //var instane = new SwaggerPetstore.SpecialModelName(); + //var instane = new OpenApiPetstore.SpecialModelName(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Tag.spec.js b/samples/client/petstore/javascript-es6/test/model/Tag.spec.js index b4aaf43538e..2213b06d509 100644 --- a/samples/client/petstore/javascript-es6/test/model/Tag.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Tag.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Tag(); + instance = new OpenApiPetstore.Tag(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('Tag', function() { it('should create an instance of Tag', function() { // uncomment below and update the code to test Tag - //var instane = new SwaggerPetstore.Tag(); - //expect(instance).to.be.a(SwaggerPetstore.Tag); + //var instane = new OpenApiPetstore.Tag(); + //expect(instance).to.be.a(OpenApiPetstore.Tag); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.Tag(); + //var instane = new OpenApiPetstore.Tag(); //expect(instance).to.be(); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Tag(); + //var instane = new OpenApiPetstore.Tag(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/User.spec.js b/samples/client/petstore/javascript-es6/test/model/User.spec.js index 19db8f90bfd..f0cd8819ec8 100644 --- a/samples/client/petstore/javascript-es6/test/model/User.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/User.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.User(); + instance = new OpenApiPetstore.User(); }); var getProperty = function(object, getter, property) { @@ -50,55 +50,55 @@ describe('User', function() { it('should create an instance of User', function() { // uncomment below and update the code to test User - //var instane = new SwaggerPetstore.User(); - //expect(instance).to.be.a(SwaggerPetstore.User); + //var instane = new OpenApiPetstore.User(); + //expect(instance).to.be.a(OpenApiPetstore.User); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property username (base name: "username")', function() { // uncomment below and update the code to test the property username - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property firstName (base name: "firstName")', function() { // uncomment below and update the code to test the property firstName - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property lastName (base name: "lastName")', function() { // uncomment below and update the code to test the property lastName - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property email (base name: "email")', function() { // uncomment below and update the code to test the property email - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property password (base name: "password")', function() { // uncomment below and update the code to test the property password - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property phone (base name: "phone")', function() { // uncomment below and update the code to test the property phone - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property userStatus (base name: "userStatus")', function() { // uncomment below and update the code to test the property userStatus - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-promise-es6/pom.xml b/samples/client/petstore/javascript-promise-es6/pom.xml index 3892dedffa2..793a531b460 100644 --- a/samples/client/petstore/javascript-promise-es6/pom.xml +++ b/samples/client/petstore/javascript-promise-es6/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - io.swagger - swagger-petstore-javascript-promise-es6 + org.openapitools + openapi-petstore-javascript-promise-es6 pom 1.0-SNAPSHOT - Swagger Petstore JS ES6 Client (Promise version) + OpenAPI Petstore JS Client (ES6, Promise) diff --git a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js index 2bb0139797c..330df9845a0 100644 --- a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js @@ -27,7 +27,7 @@ import querystring from "querystring"; * @alias module:ApiClient * @class */ -export default class ApiClient { +class ApiClient { constructor() { /** * The base URL against which to resolve every API call's (relative) path. @@ -225,43 +225,6 @@ export default class ApiClient { return newParams; } - /** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */ - static CollectionFormatEnum = { - /** - * Comma-separated values. Value: csv - * @const - */ - CSV: ',', - - /** - * Space-separated values. Value: ssv - * @const - */ - SSV: ' ', - - /** - * Tab-separated values. Value: tsv - * @const - */ - TSV: '\t', - - /** - * Pipe(|)-separated values. Value: pipes - * @const - */ - PIPES: '|', - - /** - * Native array. Value: multi - * @const - */ - MULTI: 'multi' - }; - /** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. @@ -573,8 +536,46 @@ export default class ApiClient { }; } +/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ +ApiClient.CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' +}; + /** * The default API client implementation. * @type {module:ApiClient} */ ApiClient.instance = new ApiClient(); +export default ApiClient; \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index d347940fffb..87cfae00659 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -60,7 +60,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = Boolean; + let returnType = 'Boolean'; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', @@ -152,7 +152,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = Number; + let returnType = 'Number'; return this.apiClient.callApi( '/fake/outer/number', 'POST', @@ -198,7 +198,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = String; + let returnType = 'String'; return this.apiClient.callApi( '/fake/outer/string', 'POST', diff --git a/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js b/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js deleted file mode 100644 index 9ce405845a5..00000000000 --- a/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from "../ApiClient"; -import Client from '../model/Client'; - -/** -* Fake_classname_tags123 service. -* @module api/Fake_classname_tags123Api -* @version 1.0.0 -*/ -export default class Fake_classname_tags123Api { - - /** - * Constructs a new Fake_classname_tags123Api. - * @alias module:api/Fake_classname_tags123Api - * @class - * @param {module:ApiClient} [apiClient] Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - constructor(apiClient) { - this.apiClient = apiClient || ApiClient.instance; - } - - - - /** - * To test class name in snake case - * @param {module:model/Client} body client model - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response - */ - testClassnameWithHttpInfo(body) { - let postBody = body; - - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling testClassname"); - } - - - let pathParams = { - }; - let queryParams = { - }; - let headerParams = { - }; - let formParams = { - }; - - let authNames = ['api_key_query']; - let contentTypes = ['application/json']; - let accepts = ['application/json']; - let returnType = Client; - - return this.apiClient.callApi( - '/fake_classname_test', 'PATCH', - pathParams, queryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType - ); - } - - /** - * To test class name in snake case - * @param {module:model/Client} body client model - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} - */ - testClassname(body) { - return this.testClassnameWithHttpInfo(body) - .then(function(response_and_data) { - return response_and_data.data; - }); - } - - -} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js index f21f9822eeb..583a5e44fc1 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js @@ -107,7 +107,7 @@ export default class StoreApi { let authNames = ['api_key']; let contentTypes = []; let accepts = ['application/json']; - let returnType = {String: Number}; + let returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', diff --git a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js index 98100f61564..c58384b97c3 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js @@ -315,7 +315,7 @@ export default class UserApi { let authNames = []; let contentTypes = []; let accepts = ['application/xml', 'application/json']; - let returnType = String; + let returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', diff --git a/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js index 227fb797557..d6e898a5ab0 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The AdditionalPropertiesClass model module. -* @module model/AdditionalPropertiesClass -* @version 1.0.0 -*/ -export default class AdditionalPropertiesClass { + * The AdditionalPropertiesClass model module. + * @module model/AdditionalPropertiesClass + * @version 1.0.0 + */ +class AdditionalPropertiesClass { /** - * Constructs a new AdditionalPropertiesClass. - * @alias module:model/AdditionalPropertiesClass - * @class - */ - - constructor() { - - - - - - - + * Constructs a new AdditionalPropertiesClass. + * @alias module:model/AdditionalPropertiesClass + */ + constructor() { + AdditionalPropertiesClass.initialize(this); } /** - * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. - * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new AdditionalPropertiesClass(); - - - - if (data.hasOwnProperty('map_property')) { obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'}); } @@ -66,22 +57,23 @@ export default class AdditionalPropertiesClass { return obj; } - /** - * @member {Object.} map_property - */ - map_property = undefined; - /** - * @member {Object.>} map_of_map_property - */ - map_of_map_property = undefined; - - - - - - - } +/** + * @member {Object.} map_property + */ +AdditionalPropertiesClass.prototype['map_property'] = undefined; + +/** + * @member {Object.>} map_of_map_property + */ +AdditionalPropertiesClass.prototype['map_of_map_property'] = undefined; + + + + + + +export default AdditionalPropertiesClass; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Animal.js b/samples/client/petstore/javascript-promise-es6/src/model/Animal.js index dce658d7016..c55d0c758f0 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Animal.js @@ -11,52 +11,44 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Animal model module. -* @module model/Animal -* @version 1.0.0 -*/ -export default class Animal { + * The Animal model module. + * @module model/Animal + * @version 1.0.0 + */ +class Animal { /** - * Constructs a new Animal. - * @alias module:model/Animal - * @class - * @param className {String} - */ - - constructor(className) { - - - - - - this['className'] = className; - + * Constructs a new Animal. + * @alias module:model/Animal + * @param className {String} + */ + constructor(className) { + Animal.initialize(this, className); } /** - * Constructs a Animal from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Animal} obj Optional instance to populate. - * @return {module:model/Animal} The populated Animal instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + obj['className'] = className; + } + + /** + * Constructs a Animal from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Animal} obj Optional instance to populate. + * @return {module:model/Animal} The populated Animal instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Animal(); - - - - if (data.hasOwnProperty('className')) { obj['className'] = ApiClient.convertToType(data['className'], 'String'); } @@ -67,23 +59,24 @@ export default class Animal { return obj; } - /** - * @member {String} className - */ - className = undefined; - /** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - - } +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; + +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + + + +export default Animal; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js b/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js index c0663cd1fa6..3b9cc01f03d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js @@ -11,54 +11,47 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The AnimalFarm model module. -* @module model/AnimalFarm -* @version 1.0.0 -*/ -export default class AnimalFarm extends Array { + * The AnimalFarm model module. + * @module model/AnimalFarm + * @version 1.0.0 + */ +class AnimalFarm extends Array { /** - * Constructs a new AnimalFarm. - * @alias module:model/AnimalFarm - * @class - * @extends Array - */ - - constructor() { - + * Constructs a new AnimalFarm. + * @alias module:model/AnimalFarm + * @extends Array + */ + constructor() { super(); - - - - - - return this; + AnimalFarm.initialize(this); } /** - * Constructs a AnimalFarm from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/AnimalFarm} obj Optional instance to populate. - * @return {module:model/AnimalFarm} The populated AnimalFarm instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AnimalFarm from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AnimalFarm} obj Optional instance to populate. + * @return {module:model/AnimalFarm} The populated AnimalFarm instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new AnimalFarm(); ApiClient.constructFromObject(data, obj, 'Animal'); - - } @@ -66,13 +59,12 @@ export default class AnimalFarm extends Array { } - - - - - - - } + + + + +export default AnimalFarm; + diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js index 48142ded09d..4f5fb55291c 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ApiResponse model module. -* @module model/ApiResponse -* @version 1.0.0 -*/ -export default class ApiResponse { + * The ApiResponse model module. + * @module model/ApiResponse + * @version 1.0.0 + */ +class ApiResponse { /** - * Constructs a new ApiResponse. - * @alias module:model/ApiResponse - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ApiResponse. + * @alias module:model/ApiResponse + */ + constructor() { + ApiResponse.initialize(this); } /** - * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ApiResponse} obj Optional instance to populate. - * @return {module:model/ApiResponse} The populated ApiResponse instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ApiResponse} obj Optional instance to populate. + * @return {module:model/ApiResponse} The populated ApiResponse instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ApiResponse(); - - - - if (data.hasOwnProperty('code')) { obj['code'] = ApiClient.convertToType(data['code'], 'Number'); } @@ -69,26 +60,28 @@ export default class ApiResponse { return obj; } - /** - * @member {Number} code - */ - code = undefined; - /** - * @member {String} type - */ - type = undefined; - /** - * @member {String} message - */ - message = undefined; - - - - - - - } +/** + * @member {Number} code + */ +ApiResponse.prototype['code'] = undefined; + +/** + * @member {String} type + */ +ApiResponse.prototype['type'] = undefined; + +/** + * @member {String} message + */ +ApiResponse.prototype['message'] = undefined; + + + + + + +export default ApiResponse; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js index acfac49ce0d..e8d959f3689 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ArrayOfArrayOfNumberOnly model module. -* @module model/ArrayOfArrayOfNumberOnly -* @version 1.0.0 -*/ -export default class ArrayOfArrayOfNumberOnly { + * The ArrayOfArrayOfNumberOnly model module. + * @module model/ArrayOfArrayOfNumberOnly + * @version 1.0.0 + */ +class ArrayOfArrayOfNumberOnly { /** - * Constructs a new ArrayOfArrayOfNumberOnly. - * @alias module:model/ArrayOfArrayOfNumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayOfArrayOfNumberOnly. + * @alias module:model/ArrayOfArrayOfNumberOnly + */ + constructor() { + ArrayOfArrayOfNumberOnly.initialize(this); } /** - * Constructs a ArrayOfArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayOfArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayOfArrayOfNumberOnly(); - - - - if (data.hasOwnProperty('ArrayArrayNumber')) { obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]); } @@ -63,18 +54,18 @@ export default class ArrayOfArrayOfNumberOnly { return obj; } - /** - * @member {Array.>} ArrayArrayNumber - */ - ArrayArrayNumber = undefined; - - - - - - - } +/** + * @member {Array.>} ArrayArrayNumber + */ +ArrayOfArrayOfNumberOnly.prototype['ArrayArrayNumber'] = undefined; + + + + + + +export default ArrayOfArrayOfNumberOnly; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js index 28a47d0bb7a..4fb72e435e6 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ArrayOfNumberOnly model module. -* @module model/ArrayOfNumberOnly -* @version 1.0.0 -*/ -export default class ArrayOfNumberOnly { + * The ArrayOfNumberOnly model module. + * @module model/ArrayOfNumberOnly + * @version 1.0.0 + */ +class ArrayOfNumberOnly { /** - * Constructs a new ArrayOfNumberOnly. - * @alias module:model/ArrayOfNumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayOfNumberOnly. + * @alias module:model/ArrayOfNumberOnly + */ + constructor() { + ArrayOfNumberOnly.initialize(this); } /** - * Constructs a ArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayOfNumberOnly(); - - - - if (data.hasOwnProperty('ArrayNumber')) { obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']); } @@ -63,18 +54,18 @@ export default class ArrayOfNumberOnly { return obj; } - /** - * @member {Array.} ArrayNumber - */ - ArrayNumber = undefined; - - - - - - - } +/** + * @member {Array.} ArrayNumber + */ +ArrayOfNumberOnly.prototype['ArrayNumber'] = undefined; + + + + + + +export default ArrayOfNumberOnly; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js index eff8b23dd82..8096c2c4f7f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; import ReadOnlyFirst from './ReadOnlyFirst'; - - - - /** -* The ArrayTest model module. -* @module model/ArrayTest -* @version 1.0.0 -*/ -export default class ArrayTest { + * The ArrayTest model module. + * @module model/ArrayTest + * @version 1.0.0 + */ +class ArrayTest { /** - * Constructs a new ArrayTest. - * @alias module:model/ArrayTest - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayTest. + * @alias module:model/ArrayTest + */ + constructor() { + ArrayTest.initialize(this); } /** - * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayTest} obj Optional instance to populate. - * @return {module:model/ArrayTest} The populated ArrayTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayTest} obj Optional instance to populate. + * @return {module:model/ArrayTest} The populated ArrayTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayTest(); - - - - if (data.hasOwnProperty('array_of_string')) { obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']); } @@ -70,26 +61,28 @@ export default class ArrayTest { return obj; } - /** - * @member {Array.} array_of_string - */ - array_of_string = undefined; - /** - * @member {Array.>} array_array_of_integer - */ - array_array_of_integer = undefined; - /** - * @member {Array.>} array_array_of_model - */ - array_array_of_model = undefined; - - - - - - - } +/** + * @member {Array.} array_of_string + */ +ArrayTest.prototype['array_of_string'] = undefined; + +/** + * @member {Array.>} array_array_of_integer + */ +ArrayTest.prototype['array_array_of_integer'] = undefined; + +/** + * @member {Array.>} array_array_of_model + */ +ArrayTest.prototype['array_array_of_model'] = undefined; + + + + + + +export default ArrayTest; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js b/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js index 41c6ff9af30..bc1cdefb71b 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Capitalization model module. -* @module model/Capitalization -* @version 1.0.0 -*/ -export default class Capitalization { + * The Capitalization model module. + * @module model/Capitalization + * @version 1.0.0 + */ +class Capitalization { /** - * Constructs a new Capitalization. - * @alias module:model/Capitalization - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Capitalization. + * @alias module:model/Capitalization + */ + constructor() { + Capitalization.initialize(this); } /** - * Constructs a Capitalization from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Capitalization} obj Optional instance to populate. - * @return {module:model/Capitalization} The populated Capitalization instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Capitalization from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Capitalization} obj Optional instance to populate. + * @return {module:model/Capitalization} The populated Capitalization instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Capitalization(); - - - - if (data.hasOwnProperty('smallCamel')) { obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String'); } @@ -78,39 +69,44 @@ export default class Capitalization { return obj; } - /** - * @member {String} smallCamel - */ - smallCamel = undefined; - /** - * @member {String} CapitalCamel - */ - CapitalCamel = undefined; - /** - * @member {String} small_Snake - */ - small_Snake = undefined; - /** - * @member {String} Capital_Snake - */ - Capital_Snake = undefined; - /** - * @member {String} SCA_ETH_Flow_Points - */ - SCA_ETH_Flow_Points = undefined; - /** - * Name of the pet - * @member {String} ATT_NAME - */ - ATT_NAME = undefined; - - - - - - - } +/** + * @member {String} smallCamel + */ +Capitalization.prototype['smallCamel'] = undefined; + +/** + * @member {String} CapitalCamel + */ +Capitalization.prototype['CapitalCamel'] = undefined; + +/** + * @member {String} small_Snake + */ +Capitalization.prototype['small_Snake'] = undefined; + +/** + * @member {String} Capital_Snake + */ +Capitalization.prototype['Capital_Snake'] = undefined; + +/** + * @member {String} SCA_ETH_Flow_Points + */ +Capitalization.prototype['SCA_ETH_Flow_Points'] = undefined; + +/** + * Name of the pet + * @member {String} ATT_NAME + */ +Capitalization.prototype['ATT_NAME'] = undefined; + + + + + + +export default Capitalization; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Cat.js b/samples/client/petstore/javascript-promise-es6/src/model/Cat.js index cc759099886..5ad5fb40286 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Cat.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The Cat model module. -* @module model/Cat -* @version 1.0.0 -*/ -export default class Cat { + * The Cat model module. + * @module model/Cat + * @version 1.0.0 + */ +class Cat { /** - * Constructs a new Cat. - * @alias module:model/Cat - * @class - * @extends module:model/Animal - * @implements module:model/Animal - * @param className {} - */ - - constructor(className) { - - - Animal.call(this, className); - Animal.call(this, className); - - - - + * Constructs a new Cat. + * @alias module:model/Cat + * @extends module:model/Animal + * @implements module:model/Animal + * @param className {} + */ + constructor(className) { + Animal.initialize(this, className); + Cat.initialize(this, className); } /** - * Constructs a Cat from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Cat} obj Optional instance to populate. - * @return {module:model/Cat} The populated Cat instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a Cat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Cat} obj Optional instance to populate. + * @return {module:model/Cat} The populated Cat instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Cat(); - - - Animal.constructFromObject(data, obj); Animal.constructFromObject(data, obj); @@ -68,29 +60,28 @@ export default class Cat { return obj; } - /** - * @member {Boolean} declawed - */ - declawed = undefined; - - - // Implement Animal interface: - /** - * @member {String} className - */ - className = undefined; -/** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - } +/** + * @member {Boolean} declawed + */ +Cat.prototype['declawed'] = undefined; + + +// Implement Animal interface: +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + +export default Cat; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Category.js b/samples/client/petstore/javascript-promise-es6/src/model/Category.js index cdd487022d0..fd0bf79dafb 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Category.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Category.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Category model module. -* @module model/Category -* @version 1.0.0 -*/ -export default class Category { + * The Category model module. + * @module model/Category + * @version 1.0.0 + */ +class Category { /** - * Constructs a new Category. - * @alias module:model/Category - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Category. + * @alias module:model/Category + */ + constructor() { + Category.initialize(this); } /** - * Constructs a Category from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Category} obj Optional instance to populate. - * @return {module:model/Category} The populated Category instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Category from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Category} obj Optional instance to populate. + * @return {module:model/Category} The populated Category instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Category(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -66,22 +57,23 @@ export default class Category { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} name - */ - name = undefined; - - - - - - - } +/** + * @member {Number} id + */ +Category.prototype['id'] = undefined; + +/** + * @member {String} name + */ +Category.prototype['name'] = undefined; + + + + + + +export default Category; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js b/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js index c9c39c22fff..2e55c2a6342 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ClassModel model module. -* @module model/ClassModel -* @version 1.0.0 -*/ -export default class ClassModel { + * The ClassModel model module. + * @module model/ClassModel + * @version 1.0.0 + */ +class ClassModel { /** - * Constructs a new ClassModel. - * Model for testing model with \"_class\" property - * @alias module:model/ClassModel - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ClassModel. + * Model for testing model with \"_class\" property + * @alias module:model/ClassModel + */ + constructor() { + ClassModel.initialize(this); } /** - * Constructs a ClassModel from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ClassModel} obj Optional instance to populate. - * @return {module:model/ClassModel} The populated ClassModel instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ClassModel from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ClassModel} obj Optional instance to populate. + * @return {module:model/ClassModel} The populated ClassModel instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ClassModel(); - - - - if (data.hasOwnProperty('_class')) { obj['_class'] = ApiClient.convertToType(data['_class'], 'String'); } @@ -64,18 +55,18 @@ export default class ClassModel { return obj; } - /** - * @member {String} _class - */ - _class = undefined; - - - - - - - } +/** + * @member {String} _class + */ +ClassModel.prototype['_class'] = undefined; + + + + + + +export default ClassModel; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Client.js b/samples/client/petstore/javascript-promise-es6/src/model/Client.js index 82dca1732b3..c506d2fa174 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Client.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Client.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Client model module. -* @module model/Client -* @version 1.0.0 -*/ -export default class Client { + * The Client model module. + * @module model/Client + * @version 1.0.0 + */ +class Client { /** - * Constructs a new Client. - * @alias module:model/Client - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Client. + * @alias module:model/Client + */ + constructor() { + Client.initialize(this); } /** - * Constructs a Client from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Client} obj Optional instance to populate. - * @return {module:model/Client} The populated Client instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Client from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Client} obj Optional instance to populate. + * @return {module:model/Client} The populated Client instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Client(); - - - - if (data.hasOwnProperty('client')) { obj['client'] = ApiClient.convertToType(data['client'], 'String'); } @@ -63,18 +54,18 @@ export default class Client { return obj; } - /** - * @member {String} client - */ - client = undefined; - - - - - - - } +/** + * @member {String} client + */ +Client.prototype['client'] = undefined; + + + + + + +export default Client; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Dog.js b/samples/client/petstore/javascript-promise-es6/src/model/Dog.js index 92168904822..ba225630e93 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Dog.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The Dog model module. -* @module model/Dog -* @version 1.0.0 -*/ -export default class Dog { + * The Dog model module. + * @module model/Dog + * @version 1.0.0 + */ +class Dog { /** - * Constructs a new Dog. - * @alias module:model/Dog - * @class - * @extends module:model/Animal - * @implements module:model/Animal - * @param className {} - */ - - constructor(className) { - - - Animal.call(this, className); - Animal.call(this, className); - - - - + * Constructs a new Dog. + * @alias module:model/Dog + * @extends module:model/Animal + * @implements module:model/Animal + * @param className {} + */ + constructor(className) { + Animal.initialize(this, className); + Dog.initialize(this, className); } /** - * Constructs a Dog from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Dog} obj Optional instance to populate. - * @return {module:model/Dog} The populated Dog instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a Dog from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Dog} obj Optional instance to populate. + * @return {module:model/Dog} The populated Dog instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Dog(); - - - Animal.constructFromObject(data, obj); Animal.constructFromObject(data, obj); @@ -68,29 +60,28 @@ export default class Dog { return obj; } - /** - * @member {String} breed - */ - breed = undefined; - - - // Implement Animal interface: - /** - * @member {String} className - */ - className = undefined; -/** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - } +/** + * @member {String} breed + */ +Dog.prototype['breed'] = undefined; + + +// Implement Animal interface: +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + +export default Dog; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js index f017d9a5396..9426d4735ac 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The EnumArrays model module. -* @module model/EnumArrays -* @version 1.0.0 -*/ -export default class EnumArrays { + * The EnumArrays model module. + * @module model/EnumArrays + * @version 1.0.0 + */ +class EnumArrays { /** - * Constructs a new EnumArrays. - * @alias module:model/EnumArrays - * @class - */ - - constructor() { - - - - - - - + * Constructs a new EnumArrays. + * @alias module:model/EnumArrays + */ + constructor() { + EnumArrays.initialize(this); } /** - * Constructs a EnumArrays from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/EnumArrays} obj Optional instance to populate. - * @return {module:model/EnumArrays} The populated EnumArrays instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a EnumArrays from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumArrays} obj Optional instance to populate. + * @return {module:model/EnumArrays} The populated EnumArrays instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new EnumArrays(); - - - - if (data.hasOwnProperty('just_symbol')) { obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String'); } @@ -66,62 +57,65 @@ export default class EnumArrays { return obj; } - /** - * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol - */ - just_symbol = undefined; - /** - * @member {Array.} array_enum - */ - array_enum = undefined; - - - - - - - /** - * Allowed values for the just_symbol property. - * @enum {String} - * @readonly - */ - static JustSymbolEnum = { - - /** - * value: ">=" - * @const - */ - "GREATER_THAN_OR_EQUAL_TO": ">=", - - /** - * value: "$" - * @const - */ - "DOLLAR": "$" - }; - - /** - * Allowed values for the arrayEnum property. - * @enum {String} - * @readonly - */ - static ArrayEnumEnum = { - - /** - * value: "fish" - * @const - */ - "fish": "fish", - - /** - * value: "crab" - * @const - */ - "crab": "crab" - }; - - } +/** + * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol + */ +EnumArrays.prototype['just_symbol'] = undefined; + +/** + * @member {Array.} array_enum + */ +EnumArrays.prototype['array_enum'] = undefined; + + + + + +/** + * Allowed values for the just_symbol property. + * @enum {String} + * @readonly + */ +EnumArrays['JustSymbolEnum'] = { + + /** + * value: ">=" + * @const + */ + "GREATER_THAN_OR_EQUAL_TO": ">=", + + /** + * value: "$" + * @const + */ + "DOLLAR": "$" +}; + + +/** + * Allowed values for the arrayEnum property. + * @enum {String} + * @readonly + */ +EnumArrays['ArrayEnumEnum'] = { + + /** + * value: "fish" + * @const + */ + "fish": "fish", + + /** + * value: "crab" + * @const + */ + "crab": "crab" +}; + + + +export default EnumArrays; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js index feb022bc831..65ac9f1f1bc 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js @@ -11,10 +11,7 @@ * */ - import ApiClient from '../ApiClient'; - - /** * Enum class EnumClass. * @enum {} @@ -26,21 +23,21 @@ export default class EnumClass { * value: "_abc" * @const */ - _abc = "_abc"; + "_abc" = "_abc"; /** * value: "-efg" * @const */ - -efg = "-efg"; + "-efg" = "-efg"; /** * value: "(xyz)" * @const */ - (xyz) = "(xyz)"; + "(xyz)" = "(xyz)"; @@ -54,4 +51,3 @@ export default class EnumClass { } } - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js index eaf874922b5..08828485c18 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import OuterEnum from './OuterEnum'; - - - - /** -* The EnumTest model module. -* @module model/EnumTest -* @version 1.0.0 -*/ -export default class EnumTest { + * The EnumTest model module. + * @module model/EnumTest + * @version 1.0.0 + */ +class EnumTest { /** - * Constructs a new EnumTest. - * @alias module:model/EnumTest - * @class - * @param enumStringRequired {module:model/EnumTest.EnumStringRequiredEnum} - */ - - constructor(enumStringRequired) { - - - - - - this['enum_string_required'] = enumStringRequired; - + * Constructs a new EnumTest. + * @alias module:model/EnumTest + * @param enumStringRequired {module:model/EnumTest.EnumStringRequiredEnum} + */ + constructor(enumStringRequired) { + EnumTest.initialize(this, enumStringRequired); } /** - * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/EnumTest} obj Optional instance to populate. - * @return {module:model/EnumTest} The populated EnumTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, enumStringRequired) { + obj['enum_string_required'] = enumStringRequired; + } + + /** + * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumTest} obj Optional instance to populate. + * @return {module:model/EnumTest} The populated EnumTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new EnumTest(); - - - - if (data.hasOwnProperty('enum_string')) { obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); } @@ -77,126 +69,134 @@ export default class EnumTest { return obj; } - /** - * @member {module:model/EnumTest.EnumStringEnum} enum_string - */ - enum_string = undefined; - /** - * @member {module:model/EnumTest.EnumStringRequiredEnum} enum_string_required - */ - enum_string_required = undefined; - /** - * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer - */ - enum_integer = undefined; - /** - * @member {module:model/EnumTest.EnumNumberEnum} enum_number - */ - enum_number = undefined; - /** - * @member {module:model/OuterEnum} outerEnum - */ - outerEnum = undefined; - - - - - - - /** - * Allowed values for the enum_string property. - * @enum {String} - * @readonly - */ - static EnumStringEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower", - - /** - * value: "" - * @const - */ - "empty": "" - }; - - /** - * Allowed values for the enum_string_required property. - * @enum {String} - * @readonly - */ - static EnumStringRequiredEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower", - - /** - * value: "" - * @const - */ - "empty": "" - }; - - /** - * Allowed values for the enum_integer property. - * @enum {Number} - * @readonly - */ - static EnumIntegerEnum = { - - /** - * value: 1 - * @const - */ - "1": 1, - - /** - * value: -1 - * @const - */ - "-1": -1 - }; - - /** - * Allowed values for the enum_number property. - * @enum {Number} - * @readonly - */ - static EnumNumberEnum = { - - /** - * value: 1.1 - * @const - */ - "1.1": 1.1, - - /** - * value: -1.2 - * @const - */ - "-1.2": -1.2 - }; - - } +/** + * @member {module:model/EnumTest.EnumStringEnum} enum_string + */ +EnumTest.prototype['enum_string'] = undefined; + +/** + * @member {module:model/EnumTest.EnumStringRequiredEnum} enum_string_required + */ +EnumTest.prototype['enum_string_required'] = undefined; + +/** + * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer + */ +EnumTest.prototype['enum_integer'] = undefined; + +/** + * @member {module:model/EnumTest.EnumNumberEnum} enum_number + */ +EnumTest.prototype['enum_number'] = undefined; + +/** + * @member {module:model/OuterEnum} outerEnum + */ +EnumTest.prototype['outerEnum'] = undefined; + + + + + +/** + * Allowed values for the enum_string property. + * @enum {String} + * @readonly + */ +EnumTest['EnumStringEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" +}; + + +/** + * Allowed values for the enum_string_required property. + * @enum {String} + * @readonly + */ +EnumTest['EnumStringRequiredEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" +}; + + +/** + * Allowed values for the enum_integer property. + * @enum {Number} + * @readonly + */ +EnumTest['EnumIntegerEnum'] = { + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: -1 + * @const + */ + "-1": -1 +}; + + +/** + * Allowed values for the enum_number property. + * @enum {Number} + * @readonly + */ +EnumTest['EnumNumberEnum'] = { + + /** + * value: 1.1 + * @const + */ + "1.1": 1.1, + + /** + * value: -1.2 + * @const + */ + "-1.2": -1.2 +}; + + + +export default EnumTest; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js b/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js index 7d04ffd26d3..87fa2afe86b 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js @@ -11,55 +11,50 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The FormatTest model module. -* @module model/FormatTest -* @version 1.0.0 -*/ -export default class FormatTest { + * The FormatTest model module. + * @module model/FormatTest + * @version 1.0.0 + */ +class FormatTest { /** - * Constructs a new FormatTest. - * @alias module:model/FormatTest - * @class - * @param _number {Number} - * @param _byte {Blob} - * @param _date {Date} - * @param password {String} - */ - - constructor(_number, _byte, _date, password) { - - - - - - this['number'] = _number;this['byte'] = _byte;this['date'] = _date;this['password'] = password; - + * Constructs a new FormatTest. + * @alias module:model/FormatTest + * @param _number {Number} + * @param _byte {Blob} + * @param _date {Date} + * @param password {String} + */ + constructor(_number, _byte, _date, password) { + FormatTest.initialize(this, _number, _byte, _date, password); } /** - * Constructs a FormatTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/FormatTest} obj Optional instance to populate. - * @return {module:model/FormatTest} The populated FormatTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, _number, _byte, _date, password) { + obj['number'] = _number; + obj['byte'] = _byte; + obj['date'] = _date; + obj['password'] = password; + } + + /** + * Constructs a FormatTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/FormatTest} obj Optional instance to populate. + * @return {module:model/FormatTest} The populated FormatTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new FormatTest(); - - - - if (data.hasOwnProperty('integer')) { obj['integer'] = ApiClient.convertToType(data['integer'], 'Number'); } @@ -103,66 +98,78 @@ export default class FormatTest { return obj; } - /** - * @member {Number} integer - */ - integer = undefined; - /** - * @member {Number} int32 - */ - int32 = undefined; - /** - * @member {Number} int64 - */ - int64 = undefined; - /** - * @member {Number} number - */ - number = undefined; - /** - * @member {Number} float - */ - float = undefined; - /** - * @member {Number} double - */ - double = undefined; - /** - * @member {String} string - */ - string = undefined; - /** - * @member {Blob} byte - */ - byte = undefined; - /** - * @member {File} binary - */ - binary = undefined; - /** - * @member {Date} date - */ - date = undefined; - /** - * @member {Date} dateTime - */ - dateTime = undefined; - /** - * @member {String} uuid - */ - uuid = undefined; - /** - * @member {String} password - */ - password = undefined; - - - - - - - } +/** + * @member {Number} integer + */ +FormatTest.prototype['integer'] = undefined; + +/** + * @member {Number} int32 + */ +FormatTest.prototype['int32'] = undefined; + +/** + * @member {Number} int64 + */ +FormatTest.prototype['int64'] = undefined; + +/** + * @member {Number} number + */ +FormatTest.prototype['number'] = undefined; + +/** + * @member {Number} float + */ +FormatTest.prototype['float'] = undefined; + +/** + * @member {Number} double + */ +FormatTest.prototype['double'] = undefined; + +/** + * @member {String} string + */ +FormatTest.prototype['string'] = undefined; + +/** + * @member {Blob} byte + */ +FormatTest.prototype['byte'] = undefined; + +/** + * @member {File} binary + */ +FormatTest.prototype['binary'] = undefined; + +/** + * @member {Date} date + */ +FormatTest.prototype['date'] = undefined; + +/** + * @member {Date} dateTime + */ +FormatTest.prototype['dateTime'] = undefined; + +/** + * @member {String} uuid + */ +FormatTest.prototype['uuid'] = undefined; + +/** + * @member {String} password + */ +FormatTest.prototype['password'] = undefined; + + + + + + +export default FormatTest; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js index e5f746c32ba..9c11ae559c9 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The HasOnlyReadOnly model module. -* @module model/HasOnlyReadOnly -* @version 1.0.0 -*/ -export default class HasOnlyReadOnly { + * The HasOnlyReadOnly model module. + * @module model/HasOnlyReadOnly + * @version 1.0.0 + */ +class HasOnlyReadOnly { /** - * Constructs a new HasOnlyReadOnly. - * @alias module:model/HasOnlyReadOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new HasOnlyReadOnly. + * @alias module:model/HasOnlyReadOnly + */ + constructor() { + HasOnlyReadOnly.initialize(this); } /** - * Constructs a HasOnlyReadOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/HasOnlyReadOnly} obj Optional instance to populate. - * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a HasOnlyReadOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/HasOnlyReadOnly} obj Optional instance to populate. + * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new HasOnlyReadOnly(); - - - - if (data.hasOwnProperty('bar')) { obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); } @@ -66,22 +57,23 @@ export default class HasOnlyReadOnly { return obj; } - /** - * @member {String} bar - */ - bar = undefined; - /** - * @member {String} foo - */ - foo = undefined; - - - - - - - } +/** + * @member {String} bar + */ +HasOnlyReadOnly.prototype['bar'] = undefined; + +/** + * @member {String} foo + */ +HasOnlyReadOnly.prototype['foo'] = undefined; + + + + + + +export default HasOnlyReadOnly; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/List.js b/samples/client/petstore/javascript-promise-es6/src/model/List.js index 67d6d9ef144..d4d342319e7 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/List.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/List.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The List model module. -* @module model/List -* @version 1.0.0 -*/ -export default class List { + * The List model module. + * @module model/List + * @version 1.0.0 + */ +class List { /** - * Constructs a new List. - * @alias module:model/List - * @class - */ - - constructor() { - - - - - - - + * Constructs a new List. + * @alias module:model/List + */ + constructor() { + List.initialize(this); } /** - * Constructs a List from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/List} obj Optional instance to populate. - * @return {module:model/List} The populated List instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a List from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/List} obj Optional instance to populate. + * @return {module:model/List} The populated List instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new List(); - - - - if (data.hasOwnProperty('123-list')) { obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String'); } @@ -63,18 +54,18 @@ export default class List { return obj; } - /** - * @member {String} 123-list - */ - 123-list = undefined; - - - - - - - } +/** + * @member {String} 123-list + */ +List.prototype['123-list'] = undefined; + + + + + + +export default List; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js b/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js index e4be468e253..8cc6640c9d4 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The MapTest model module. -* @module model/MapTest -* @version 1.0.0 -*/ -export default class MapTest { + * The MapTest model module. + * @module model/MapTest + * @version 1.0.0 + */ +class MapTest { /** - * Constructs a new MapTest. - * @alias module:model/MapTest - * @class - */ - - constructor() { - - - - - - - + * Constructs a new MapTest. + * @alias module:model/MapTest + */ + constructor() { + MapTest.initialize(this); } /** - * Constructs a MapTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/MapTest} obj Optional instance to populate. - * @return {module:model/MapTest} The populated MapTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a MapTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MapTest} obj Optional instance to populate. + * @return {module:model/MapTest} The populated MapTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new MapTest(); - - - - if (data.hasOwnProperty('map_map_of_string')) { obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}}); } @@ -66,42 +57,44 @@ export default class MapTest { return obj; } - /** - * @member {Object.>} map_map_of_string - */ - map_map_of_string = undefined; - /** - * @member {Object.} map_of_enum_string - */ - map_of_enum_string = undefined; - - - - - - - /** - * Allowed values for the inner property. - * @enum {String} - * @readonly - */ - static InnerEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower" - }; - - } +/** + * @member {Object.>} map_map_of_string + */ +MapTest.prototype['map_map_of_string'] = undefined; + +/** + * @member {Object.} map_of_enum_string + */ +MapTest.prototype['map_of_enum_string'] = undefined; + + + + + +/** + * Allowed values for the inner property. + * @enum {String} + * @readonly + */ +MapTest['InnerEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower" +}; + + + +export default MapTest; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 17ea09bd69a..5568d3a6e96 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The MixedPropertiesAndAdditionalPropertiesClass model module. -* @module model/MixedPropertiesAndAdditionalPropertiesClass -* @version 1.0.0 -*/ -export default class MixedPropertiesAndAdditionalPropertiesClass { + * The MixedPropertiesAndAdditionalPropertiesClass model module. + * @module model/MixedPropertiesAndAdditionalPropertiesClass + * @version 1.0.0 + */ +class MixedPropertiesAndAdditionalPropertiesClass { /** - * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. - * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass - * @class - */ - - constructor() { - - - - - - - + * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. + * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass + */ + constructor() { + MixedPropertiesAndAdditionalPropertiesClass.initialize(this); } /** - * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. - * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new MixedPropertiesAndAdditionalPropertiesClass(); - - - - if (data.hasOwnProperty('uuid')) { obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); } @@ -70,26 +61,28 @@ export default class MixedPropertiesAndAdditionalPropertiesClass { return obj; } - /** - * @member {String} uuid - */ - uuid = undefined; - /** - * @member {Date} dateTime - */ - dateTime = undefined; - /** - * @member {Object.} map - */ - map = undefined; - - - - - - - } +/** + * @member {String} uuid + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['uuid'] = undefined; + +/** + * @member {Date} dateTime + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['dateTime'] = undefined; + +/** + * @member {Object.} map + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['map'] = undefined; + + + + + + +export default MixedPropertiesAndAdditionalPropertiesClass; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js b/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js index 3dbecac1336..629b0f0c75a 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Model200Response model module. -* @module model/Model200Response -* @version 1.0.0 -*/ -export default class Model200Response { + * The Model200Response model module. + * @module model/Model200Response + * @version 1.0.0 + */ +class Model200Response { /** - * Constructs a new Model200Response. - * Model for testing model name starting with number - * @alias module:model/Model200Response - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Model200Response. + * Model for testing model name starting with number + * @alias module:model/Model200Response + */ + constructor() { + Model200Response.initialize(this); } /** - * Constructs a Model200Response from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Model200Response} obj Optional instance to populate. - * @return {module:model/Model200Response} The populated Model200Response instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Model200Response from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Model200Response} obj Optional instance to populate. + * @return {module:model/Model200Response} The populated Model200Response instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Model200Response(); - - - - if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'Number'); } @@ -67,22 +58,23 @@ export default class Model200Response { return obj; } - /** - * @member {Number} name - */ - name = undefined; - /** - * @member {String} class - */ - class = undefined; - - - - - - - } +/** + * @member {Number} name + */ +Model200Response.prototype['name'] = undefined; + +/** + * @member {String} class + */ +Model200Response.prototype['class'] = undefined; + + + + + + +export default Model200Response; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js index 0f287b72281..9ad0c11befc 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ModelReturn model module. -* @module model/ModelReturn -* @version 1.0.0 -*/ -export default class ModelReturn { + * The ModelReturn model module. + * @module model/ModelReturn + * @version 1.0.0 + */ +class ModelReturn { /** - * Constructs a new ModelReturn. - * Model for testing reserved words - * @alias module:model/ModelReturn - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ModelReturn. + * Model for testing reserved words + * @alias module:model/ModelReturn + */ + constructor() { + ModelReturn.initialize(this); } /** - * Constructs a ModelReturn from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ModelReturn} obj Optional instance to populate. - * @return {module:model/ModelReturn} The populated ModelReturn instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ModelReturn from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ModelReturn} obj Optional instance to populate. + * @return {module:model/ModelReturn} The populated ModelReturn instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ModelReturn(); - - - - if (data.hasOwnProperty('return')) { obj['return'] = ApiClient.convertToType(data['return'], 'Number'); } @@ -64,18 +55,18 @@ export default class ModelReturn { return obj; } - /** - * @member {Number} return - */ - return = undefined; - - - - - - - } +/** + * @member {Number} return + */ +ModelReturn.prototype['return'] = undefined; + + + + + + +export default ModelReturn; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Name.js b/samples/client/petstore/javascript-promise-es6/src/model/Name.js index 0da2f21ca4c..63e7d52e5ff 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Name.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Name.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Name model module. -* @module model/Name -* @version 1.0.0 -*/ -export default class Name { + * The Name model module. + * @module model/Name + * @version 1.0.0 + */ +class Name { /** - * Constructs a new Name. - * Model for testing model name same as property name - * @alias module:model/Name - * @class - * @param name {Number} - */ - - constructor(name) { - - - - - - this['name'] = name; - + * Constructs a new Name. + * Model for testing model name same as property name + * @alias module:model/Name + * @param name {Number} + */ + constructor(name) { + Name.initialize(this, name); } /** - * Constructs a Name from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Name} obj Optional instance to populate. - * @return {module:model/Name} The populated Name instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name) { + obj['name'] = name; + } + + /** + * Constructs a Name from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Name} obj Optional instance to populate. + * @return {module:model/Name} The populated Name instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Name(); - - - - if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'Number'); } @@ -74,30 +66,33 @@ export default class Name { return obj; } - /** - * @member {Number} name - */ - name = undefined; - /** - * @member {Number} snake_case - */ - snake_case = undefined; - /** - * @member {String} property - */ - property = undefined; - /** - * @member {Number} 123Number - */ - 123Number = undefined; - - - - - - - } +/** + * @member {Number} name + */ +Name.prototype['name'] = undefined; + +/** + * @member {Number} snake_case + */ +Name.prototype['snake_case'] = undefined; + +/** + * @member {String} property + */ +Name.prototype['property'] = undefined; + +/** + * @member {Number} 123Number + */ +Name.prototype['123Number'] = undefined; + + + + + + +export default Name; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js index e1f7978f7f6..ec5ad812b40 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The NumberOnly model module. -* @module model/NumberOnly -* @version 1.0.0 -*/ -export default class NumberOnly { + * The NumberOnly model module. + * @module model/NumberOnly + * @version 1.0.0 + */ +class NumberOnly { /** - * Constructs a new NumberOnly. - * @alias module:model/NumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new NumberOnly. + * @alias module:model/NumberOnly + */ + constructor() { + NumberOnly.initialize(this); } /** - * Constructs a NumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/NumberOnly} obj Optional instance to populate. - * @return {module:model/NumberOnly} The populated NumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a NumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/NumberOnly} obj Optional instance to populate. + * @return {module:model/NumberOnly} The populated NumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new NumberOnly(); - - - - if (data.hasOwnProperty('JustNumber')) { obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number'); } @@ -63,18 +54,18 @@ export default class NumberOnly { return obj; } - /** - * @member {Number} JustNumber - */ - JustNumber = undefined; - - - - - - - } +/** + * @member {Number} JustNumber + */ +NumberOnly.prototype['JustNumber'] = undefined; + + + + + + +export default NumberOnly; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Order.js b/samples/client/petstore/javascript-promise-es6/src/model/Order.js index fb8bdd4ab9f..8c07a5cd0f3 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Order.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Order.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Order model module. -* @module model/Order -* @version 1.0.0 -*/ -export default class Order { + * The Order model module. + * @module model/Order + * @version 1.0.0 + */ +class Order { /** - * Constructs a new Order. - * @alias module:model/Order - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Order. + * @alias module:model/Order + */ + constructor() { + Order.initialize(this); } /** - * Constructs a Order from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Order} obj Optional instance to populate. - * @return {module:model/Order} The populated Order instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Order from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Order} obj Optional instance to populate. + * @return {module:model/Order} The populated Order instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Order(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -78,66 +69,72 @@ export default class Order { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {Number} petId - */ - petId = undefined; - /** - * @member {Number} quantity - */ - quantity = undefined; - /** - * @member {Date} shipDate - */ - shipDate = undefined; - /** - * Order Status - * @member {module:model/Order.StatusEnum} status - */ - status = undefined; - /** - * @member {Boolean} complete - * @default false - */ - complete = false; - - - - - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - static StatusEnum = { - - /** - * value: "placed" - * @const - */ - "placed": "placed", - - /** - * value: "approved" - * @const - */ - "approved": "approved", - - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" - }; - - } +/** + * @member {Number} id + */ +Order.prototype['id'] = undefined; + +/** + * @member {Number} petId + */ +Order.prototype['petId'] = undefined; + +/** + * @member {Number} quantity + */ +Order.prototype['quantity'] = undefined; + +/** + * @member {Date} shipDate + */ +Order.prototype['shipDate'] = undefined; + +/** + * Order Status + * @member {module:model/Order.StatusEnum} status + */ +Order.prototype['status'] = undefined; + +/** + * @member {Boolean} complete + * @default false + */ +Order.prototype['complete'] = false; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +Order['StatusEnum'] = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" +}; + + + +export default Order; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js deleted file mode 100644 index 592a0b69864..00000000000 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterBoolean model module. -* @module model/OuterBoolean -* @version 1.0.0 -*/ -export default class OuterBoolean { - /** - * Constructs a new OuterBoolean. - * @alias module:model/OuterBoolean - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterBoolean from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterBoolean} obj Optional instance to populate. - * @return {module:model/OuterBoolean} The populated OuterBoolean instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterBoolean(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js index ebacb2837d8..8b61cb8f654 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The OuterComposite model module. -* @module model/OuterComposite -* @version 1.0.0 -*/ -export default class OuterComposite { + * The OuterComposite model module. + * @module model/OuterComposite + * @version 1.0.0 + */ +class OuterComposite { /** - * Constructs a new OuterComposite. - * @alias module:model/OuterComposite - * @class - */ - - constructor() { - - - - - - - + * Constructs a new OuterComposite. + * @alias module:model/OuterComposite + */ + constructor() { + OuterComposite.initialize(this); } /** - * Constructs a OuterComposite from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterComposite} obj Optional instance to populate. - * @return {module:model/OuterComposite} The populated OuterComposite instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a OuterComposite from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OuterComposite} obj Optional instance to populate. + * @return {module:model/OuterComposite} The populated OuterComposite instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new OuterComposite(); - - - - if (data.hasOwnProperty('my_number')) { obj['my_number'] = 'Number'.constructFromObject(data['my_number']); } @@ -69,26 +60,28 @@ export default class OuterComposite { return obj; } - /** - * @member {Number} my_number - */ - my_number = undefined; - /** - * @member {String} my_string - */ - my_string = undefined; - /** - * @member {Boolean} my_boolean - */ - my_boolean = undefined; - - - - - - - } +/** + * @member {Number} my_number + */ +OuterComposite.prototype['my_number'] = undefined; + +/** + * @member {String} my_string + */ +OuterComposite.prototype['my_string'] = undefined; + +/** + * @member {Boolean} my_boolean + */ +OuterComposite.prototype['my_boolean'] = undefined; + + + + + + +export default OuterComposite; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js index a31e00b729d..0404b03b061 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js @@ -11,10 +11,7 @@ * */ - import ApiClient from '../ApiClient'; - - /** * Enum class OuterEnum. * @enum {} @@ -26,21 +23,21 @@ export default class OuterEnum { * value: "placed" * @const */ - placed = "placed"; + "placed" = "placed"; /** * value: "approved" * @const */ - approved = "approved"; + "approved" = "approved"; /** * value: "delivered" * @const */ - delivered = "delivered"; + "delivered" = "delivered"; @@ -54,4 +51,3 @@ export default class OuterEnum { } } - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js deleted file mode 100644 index ff65b1588b7..00000000000 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterNumber model module. -* @module model/OuterNumber -* @version 1.0.0 -*/ -export default class OuterNumber { - /** - * Constructs a new OuterNumber. - * @alias module:model/OuterNumber - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterNumber from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterNumber} obj Optional instance to populate. - * @return {module:model/OuterNumber} The populated OuterNumber instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterNumber(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js deleted file mode 100644 index 6921029ede1..00000000000 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterString model module. -* @module model/OuterString -* @version 1.0.0 -*/ -export default class OuterString { - /** - * Constructs a new OuterString. - * @alias module:model/OuterString - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterString from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterString} obj Optional instance to populate. - * @return {module:model/OuterString} The populated OuterString instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterString(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js index 4edbd6e3d75..37b987fdf81 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js @@ -11,55 +11,48 @@ * */ - import ApiClient from '../ApiClient'; import Category from './Category'; import Tag from './Tag'; - - - - /** -* The Pet model module. -* @module model/Pet -* @version 1.0.0 -*/ -export default class Pet { + * The Pet model module. + * @module model/Pet + * @version 1.0.0 + */ +class Pet { /** - * Constructs a new Pet. - * @alias module:model/Pet - * @class - * @param name {String} - * @param photoUrls {Array.} - */ - - constructor(name, photoUrls) { - - - - - - this['name'] = name;this['photoUrls'] = photoUrls; - + * Constructs a new Pet. + * @alias module:model/Pet + * @param name {String} + * @param photoUrls {Array.} + */ + constructor(name, photoUrls) { + Pet.initialize(this, name, photoUrls); } /** - * Constructs a Pet from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Pet} obj Optional instance to populate. - * @return {module:model/Pet} The populated Pet instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name, photoUrls) { + obj['name'] = name; + obj['photoUrls'] = photoUrls; + } + + /** + * Constructs a Pet from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Pet} obj Optional instance to populate. + * @return {module:model/Pet} The populated Pet instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Pet(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -82,65 +75,71 @@ export default class Pet { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {module:model/Category} category - */ - category = undefined; - /** - * @member {String} name - */ - name = undefined; - /** - * @member {Array.} photoUrls - */ - photoUrls = undefined; - /** - * @member {Array.} tags - */ - tags = undefined; - /** - * pet status in the store - * @member {module:model/Pet.StatusEnum} status - */ - status = undefined; - - - - - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - static StatusEnum = { - - /** - * value: "available" - * @const - */ - "available": "available", - - /** - * value: "pending" - * @const - */ - "pending": "pending", - - /** - * value: "sold" - * @const - */ - "sold": "sold" - }; - - } +/** + * @member {Number} id + */ +Pet.prototype['id'] = undefined; + +/** + * @member {module:model/Category} category + */ +Pet.prototype['category'] = undefined; + +/** + * @member {String} name + */ +Pet.prototype['name'] = undefined; + +/** + * @member {Array.} photoUrls + */ +Pet.prototype['photoUrls'] = undefined; + +/** + * @member {Array.} tags + */ +Pet.prototype['tags'] = undefined; + +/** + * pet status in the store + * @member {module:model/Pet.StatusEnum} status + */ +Pet.prototype['status'] = undefined; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +Pet['StatusEnum'] = { + + /** + * value: "available" + * @const + */ + "available": "available", + + /** + * value: "pending" + * @const + */ + "pending": "pending", + + /** + * value: "sold" + * @const + */ + "sold": "sold" +}; + + + +export default Pet; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js index 5aee0fce320..289277c191d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ReadOnlyFirst model module. -* @module model/ReadOnlyFirst -* @version 1.0.0 -*/ -export default class ReadOnlyFirst { + * The ReadOnlyFirst model module. + * @module model/ReadOnlyFirst + * @version 1.0.0 + */ +class ReadOnlyFirst { /** - * Constructs a new ReadOnlyFirst. - * @alias module:model/ReadOnlyFirst - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ReadOnlyFirst. + * @alias module:model/ReadOnlyFirst + */ + constructor() { + ReadOnlyFirst.initialize(this); } /** - * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. - * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. + * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ReadOnlyFirst(); - - - - if (data.hasOwnProperty('bar')) { obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); } @@ -66,22 +57,23 @@ export default class ReadOnlyFirst { return obj; } - /** - * @member {String} bar - */ - bar = undefined; - /** - * @member {String} baz - */ - baz = undefined; - - - - - - - } +/** + * @member {String} bar + */ +ReadOnlyFirst.prototype['bar'] = undefined; + +/** + * @member {String} baz + */ +ReadOnlyFirst.prototype['baz'] = undefined; + + + + + + +export default ReadOnlyFirst; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js index c00da7303e9..be9f36a855f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The SpecialModelName model module. -* @module model/SpecialModelName -* @version 1.0.0 -*/ -export default class SpecialModelName { + * The SpecialModelName model module. + * @module model/SpecialModelName + * @version 1.0.0 + */ +class SpecialModelName { /** - * Constructs a new SpecialModelName. - * @alias module:model/SpecialModelName - * @class - */ - - constructor() { - - - - - - - + * Constructs a new SpecialModelName. + * @alias module:model/SpecialModelName + */ + constructor() { + SpecialModelName.initialize(this); } /** - * Constructs a SpecialModelName from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/SpecialModelName} obj Optional instance to populate. - * @return {module:model/SpecialModelName} The populated SpecialModelName instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a SpecialModelName from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SpecialModelName} obj Optional instance to populate. + * @return {module:model/SpecialModelName} The populated SpecialModelName instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new SpecialModelName(); - - - - if (data.hasOwnProperty('$special[property.name]')) { obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number'); } @@ -63,18 +54,18 @@ export default class SpecialModelName { return obj; } - /** - * @member {Number} $special[property.name] - */ - $special[property.name] = undefined; - - - - - - - } +/** + * @member {Number} $special[property.name] + */ +SpecialModelName.prototype['$special[property.name]'] = undefined; + + + + + + +export default SpecialModelName; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Tag.js b/samples/client/petstore/javascript-promise-es6/src/model/Tag.js index 994da23e2a7..0d39a36833a 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Tag.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Tag model module. -* @module model/Tag -* @version 1.0.0 -*/ -export default class Tag { + * The Tag model module. + * @module model/Tag + * @version 1.0.0 + */ +class Tag { /** - * Constructs a new Tag. - * @alias module:model/Tag - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Tag. + * @alias module:model/Tag + */ + constructor() { + Tag.initialize(this); } /** - * Constructs a Tag from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Tag} obj Optional instance to populate. - * @return {module:model/Tag} The populated Tag instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Tag from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Tag} obj Optional instance to populate. + * @return {module:model/Tag} The populated Tag instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Tag(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -66,22 +57,23 @@ export default class Tag { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} name - */ - name = undefined; - - - - - - - } +/** + * @member {Number} id + */ +Tag.prototype['id'] = undefined; + +/** + * @member {String} name + */ +Tag.prototype['name'] = undefined; + + + + + + +export default Tag; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/User.js b/samples/client/petstore/javascript-promise-es6/src/model/User.js index c0f5ef56e6f..7f8e2848e18 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/User.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/User.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The User model module. -* @module model/User -* @version 1.0.0 -*/ -export default class User { + * The User model module. + * @module model/User + * @version 1.0.0 + */ +class User { /** - * Constructs a new User. - * @alias module:model/User - * @class - */ - - constructor() { - - - - - - - + * Constructs a new User. + * @alias module:model/User + */ + constructor() { + User.initialize(this); } /** - * Constructs a User from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/User} obj Optional instance to populate. - * @return {module:model/User} The populated User instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a User from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/User} obj Optional instance to populate. + * @return {module:model/User} The populated User instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new User(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -84,47 +75,54 @@ export default class User { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} username - */ - username = undefined; - /** - * @member {String} firstName - */ - firstName = undefined; - /** - * @member {String} lastName - */ - lastName = undefined; - /** - * @member {String} email - */ - email = undefined; - /** - * @member {String} password - */ - password = undefined; - /** - * @member {String} phone - */ - phone = undefined; - /** - * User Status - * @member {Number} userStatus - */ - userStatus = undefined; - - - - - - - } +/** + * @member {Number} id + */ +User.prototype['id'] = undefined; + +/** + * @member {String} username + */ +User.prototype['username'] = undefined; + +/** + * @member {String} firstName + */ +User.prototype['firstName'] = undefined; + +/** + * @member {String} lastName + */ +User.prototype['lastName'] = undefined; + +/** + * @member {String} email + */ +User.prototype['email'] = undefined; + +/** + * @member {String} password + */ +User.prototype['password'] = undefined; + +/** + * @member {String} phone + */ +User.prototype['phone'] = undefined; + +/** + * User Status + * @member {Number} userStatus + */ +User.prototype['userStatus'] = undefined; + + + + + + +export default User; diff --git a/samples/client/petstore/javascript-promise-es6/test/ApiClientTest.js b/samples/client/petstore/javascript-promise-es6/test/ApiClientTest.js new file mode 100644 index 00000000000..5e98b685a91 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/samples/client/petstore/javascript-promise-es6/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/OuterBoolean.spec.js index 7560cff154b..400fbecfb13 100644 --- a/samples/client/petstore/javascript-promise-es6/test/model/OuterBoolean.spec.js +++ b/samples/client/petstore/javascript-promise-es6/test/model/OuterBoolean.spec.js @@ -31,7 +31,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterBoolean(); + // OuterBoolean is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterBoolean(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise-es6/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/OuterNumber.spec.js index 4dbe9d889bb..9cf8d6ac4b8 100644 --- a/samples/client/petstore/javascript-promise-es6/test/model/OuterNumber.spec.js +++ b/samples/client/petstore/javascript-promise-es6/test/model/OuterNumber.spec.js @@ -31,7 +31,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterNumber(); + // OuterNumber is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterNumber(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise-es6/test/model/OuterString.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/OuterString.spec.js index d0f6a8fbd9d..93f6e8e4cab 100644 --- a/samples/client/petstore/javascript-promise-es6/test/model/OuterString.spec.js +++ b/samples/client/petstore/javascript-promise-es6/test/model/OuterString.spec.js @@ -31,7 +31,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterString(); + // OuterString is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterString(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise/pom.xml b/samples/client/petstore/javascript-promise/pom.xml index d77a24fcd75..7aa5b80ba8c 100644 --- a/samples/client/petstore/javascript-promise/pom.xml +++ b/samples/client/petstore/javascript-promise/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - io.swagger - swagger-petstore-javascript-promise + org.openapitools + openapi-petstore-javascript-promise pom 1.0-SNAPSHOT - Swagger Petstore - Javascript Client (Promise version) + OpenAPI Petstore JS Client (Promise) diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 7144e267fde..8b07f17c78f 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -73,7 +73,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = Boolean; + var returnType = 'Boolean'; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', @@ -169,7 +169,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = Number; + var returnType = 'Number'; return this.apiClient.callApi( '/fake/outer/number', 'POST', @@ -217,7 +217,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = String; + var returnType = 'String'; return this.apiClient.callApi( '/fake/outer/string', 'POST', diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index 08268a9849c..c4b2f93bbc0 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -124,7 +124,7 @@ var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; - var returnType = {String: Number}; + var returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index babd9e513c6..4942cbc464b 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -340,7 +340,7 @@ var authNames = []; var contentTypes = []; var accepts = ['application/xml', 'application/json']; - var returnType = String; + var returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', diff --git a/samples/client/petstore/javascript-promise/test/ApiClientTest.js b/samples/client/petstore/javascript-promise/test/ApiClientTest.js index b58a27a025b..5e98b685a91 100644 --- a/samples/client/petstore/javascript-promise/test/ApiClientTest.js +++ b/samples/client/petstore/javascript-promise/test/ApiClientTest.js @@ -14,7 +14,8 @@ describe('ApiClient', function() { expect(apiClient.authentications).to.eql({ petstore_auth: {type: 'oauth2'}, http_basic_test: {type: 'basic'}, - api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'} + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, /* comment out the following as these fake security def (testing purpose) * are removed from the spec, we'll add these back after updating the * petstore server diff --git a/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js index d5495a638d8..765f758cd09 100644 --- a/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js +++ b/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterBoolean(); + // OuterBoolean is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterBoolean(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js index 7b0e4ebf119..2466fbe6dc9 100644 --- a/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js +++ b/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterNumber(); + // OuterNumber is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterNumber(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js index 4e7f99ca88d..46d6c579bc9 100644 --- a/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js +++ b/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterString(); + // OuterString is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterString(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index e36feba7bd5..71cb70f8be7 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -81,7 +81,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = Boolean; + var returnType = 'Boolean'; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', @@ -167,7 +167,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = Number; + var returnType = 'Number'; return this.apiClient.callApi( '/fake/outer/number', 'POST', @@ -210,7 +210,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = String; + var returnType = 'String'; return this.apiClient.callApi( '/fake/outer/string', 'POST', diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index f09beb807df..ba2c675ec77 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -126,7 +126,7 @@ var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; - var returnType = {String: Number}; + var returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index 319572cf2a6..d3e3b8513c5 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -322,7 +322,7 @@ var authNames = []; var contentTypes = []; var accepts = ['application/xml', 'application/json']; - var returnType = String; + var returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET',