From d80e29585205bcaf186914a28c78b556218a5a62 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 13 May 2018 10:19:16 +0800 Subject: [PATCH] Fix JS test using baseName in default value (#5) * fix js test using baseName in default value * re-enable JS test --- .../languages/JavascriptClientCodegen.java | 2 +- pom.xml | 2 +- .../docs/AdditionalPropertiesClass.md | 9 - .../client/petstore/javascript/docs/Animal.md | 9 - .../petstore/javascript/docs/AnimalFarm.md | 7 - .../javascript/docs/AnotherFakeApi.md | 52 -- .../petstore/javascript/docs/ApiResponse.md | 10 - .../docs/ArrayOfArrayOfNumberOnly.md | 8 - .../javascript/docs/ArrayOfNumberOnly.md | 8 - .../petstore/javascript/docs/ArrayTest.md | 10 - .../javascript/docs/Capitalization.md | 13 - .../client/petstore/javascript/docs/Cat.md | 8 - .../petstore/javascript/docs/Category.md | 9 - .../petstore/javascript/docs/ClassModel.md | 8 - .../client/petstore/javascript/docs/Client.md | 8 - .../client/petstore/javascript/docs/Dog.md | 8 - .../petstore/javascript/docs/EnumArrays.md | 31 -- .../petstore/javascript/docs/EnumClass.md | 12 - .../petstore/javascript/docs/EnumTest.md | 60 --- .../petstore/javascript/docs/FakeApi.md | 504 ------------------ .../docs/FakeClassnameTags123Api.md | 58 -- .../petstore/javascript/docs/FormatTest.md | 20 - .../javascript/docs/HasOnlyReadOnly.md | 9 - .../client/petstore/javascript/docs/List.md | 8 - .../petstore/javascript/docs/MapTest.md | 20 - ...dPropertiesAndAdditionalPropertiesClass.md | 10 - .../javascript/docs/Model200Response.md | 9 - .../petstore/javascript/docs/ModelReturn.md | 8 - .../client/petstore/javascript/docs/Name.md | 11 - .../petstore/javascript/docs/NumberOnly.md | 8 - .../client/petstore/javascript/docs/Order.md | 26 - .../javascript/docs/OuterComposite.md | 10 - .../petstore/javascript/docs/OuterEnum.md | 12 - .../client/petstore/javascript/docs/Pet.md | 26 - .../client/petstore/javascript/docs/PetApi.md | 400 -------------- .../petstore/javascript/docs/ReadOnlyFirst.md | 9 - .../javascript/docs/SpecialModelName.md | 8 - .../petstore/javascript/docs/StoreApi.md | 184 ------- .../client/petstore/javascript/docs/Tag.md | 9 - .../client/petstore/javascript/docs/User.md | 15 - .../petstore/javascript/docs/UserApi.md | 350 ------------ .../petstore/javascript/src/model/EnumTest.js | 2 +- .../javascript/src/model/OuterComposite.js | 6 +- .../petstore/javascript/src/model/Pet.js | 2 +- .../test/api/AnotherFakeApi.spec.js | 13 +- .../test/api/FakeClassnameTags123Api.spec.js | 13 +- 46 files changed, 19 insertions(+), 2005 deletions(-) delete mode 100644 samples/client/petstore/javascript/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/javascript/docs/Animal.md delete mode 100644 samples/client/petstore/javascript/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/javascript/docs/AnotherFakeApi.md delete mode 100644 samples/client/petstore/javascript/docs/ApiResponse.md delete mode 100644 samples/client/petstore/javascript/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/javascript/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/javascript/docs/ArrayTest.md delete mode 100644 samples/client/petstore/javascript/docs/Capitalization.md delete mode 100644 samples/client/petstore/javascript/docs/Cat.md delete mode 100644 samples/client/petstore/javascript/docs/Category.md delete mode 100644 samples/client/petstore/javascript/docs/ClassModel.md delete mode 100644 samples/client/petstore/javascript/docs/Client.md delete mode 100644 samples/client/petstore/javascript/docs/Dog.md delete mode 100644 samples/client/petstore/javascript/docs/EnumArrays.md delete mode 100644 samples/client/petstore/javascript/docs/EnumClass.md delete mode 100644 samples/client/petstore/javascript/docs/EnumTest.md delete mode 100644 samples/client/petstore/javascript/docs/FakeApi.md delete mode 100644 samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md delete mode 100644 samples/client/petstore/javascript/docs/FormatTest.md delete mode 100644 samples/client/petstore/javascript/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/javascript/docs/List.md delete mode 100644 samples/client/petstore/javascript/docs/MapTest.md delete mode 100644 samples/client/petstore/javascript/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/javascript/docs/Model200Response.md delete mode 100644 samples/client/petstore/javascript/docs/ModelReturn.md delete mode 100644 samples/client/petstore/javascript/docs/Name.md delete mode 100644 samples/client/petstore/javascript/docs/NumberOnly.md delete mode 100644 samples/client/petstore/javascript/docs/Order.md delete mode 100644 samples/client/petstore/javascript/docs/OuterComposite.md delete mode 100644 samples/client/petstore/javascript/docs/OuterEnum.md delete mode 100644 samples/client/petstore/javascript/docs/Pet.md delete mode 100644 samples/client/petstore/javascript/docs/PetApi.md delete mode 100644 samples/client/petstore/javascript/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/javascript/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/javascript/docs/StoreApi.md delete mode 100644 samples/client/petstore/javascript/docs/Tag.md delete mode 100644 samples/client/petstore/javascript/docs/User.md delete mode 100644 samples/client/petstore/javascript/docs/UserApi.md 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 8e78db831f..612a2fba38 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 @@ -617,7 +617,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo public String toDefaultValueWithParam(String name, Schema p) { String type = normalizeType(getTypeDeclaration(p)); if (!StringUtils.isEmpty(p.get$ref())) { - return " = " + type + ".constructFromObject(data['" + getSchemaType(p) + "']);"; + return " = " + type + ".constructFromObject(data['" + name + "']);"; } else { return " = ApiClient.convertToType(data['" + name + "'], " + type + ");"; } diff --git a/pom.xml b/pom.xml index 9fbdaac3fe..6e0687016c 100644 --- a/pom.xml +++ b/pom.xml @@ -857,7 +857,7 @@ samples/openapi3/client/petstore/php/OpenAPIClient-php samples/client/petstore/scala samples/client/petstore/akka-scala - + samples/client/petstore/javascript samples/client/petstore/python samples/client/petstore/python-tornado samples/client/petstore/python-asyncio diff --git a/samples/client/petstore/javascript/docs/AdditionalPropertiesClass.md b/samples/client/petstore/javascript/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 7df1c7b339..0000000000 --- a/samples/client/petstore/javascript/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# OpenApiPetstore.AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **{String: String}** | | [optional] -**mapOfMapProperty** | **{String: {String: String}}** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Animal.md b/samples/client/petstore/javascript/docs/Animal.md deleted file mode 100644 index 7bff016758..0000000000 --- a/samples/client/petstore/javascript/docs/Animal.md +++ /dev/null @@ -1,9 +0,0 @@ -# OpenApiPetstore.Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] - - diff --git a/samples/client/petstore/javascript/docs/AnimalFarm.md b/samples/client/petstore/javascript/docs/AnimalFarm.md deleted file mode 100644 index ab153513ca..0000000000 --- a/samples/client/petstore/javascript/docs/AnimalFarm.md +++ /dev/null @@ -1,7 +0,0 @@ -# OpenApiPetstore.AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/samples/client/petstore/javascript/docs/AnotherFakeApi.md b/samples/client/petstore/javascript/docs/AnotherFakeApi.md deleted file mode 100644 index 4529aa0c18..0000000000 --- a/samples/client/petstore/javascript/docs/AnotherFakeApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# OpenApiPetstore.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - - - -# **testSpecialTags** -> Client testSpecialTags(client) - -To test special tags - -To test special tags - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.AnotherFakeApi(); -var client = new OpenApiPetstore.Client(); // Client | client model -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.testSpecialTags(client, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/javascript/docs/ApiResponse.md b/samples/client/petstore/javascript/docs/ApiResponse.md deleted file mode 100644 index e60378fcbf..0000000000 --- a/samples/client/petstore/javascript/docs/ApiResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# OpenApiPetstore.ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Number** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/javascript/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 7a1426ef81..0000000000 --- a/samples/client/petstore/javascript/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | **[[Number]]** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/ArrayOfNumberOnly.md b/samples/client/petstore/javascript/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 7cec2e71d4..0000000000 --- a/samples/client/petstore/javascript/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **[Number]** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/ArrayTest.md b/samples/client/petstore/javascript/docs/ArrayTest.md deleted file mode 100644 index 5828f6ee75..0000000000 --- a/samples/client/petstore/javascript/docs/ArrayTest.md +++ /dev/null @@ -1,10 +0,0 @@ -# OpenApiPetstore.ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **[String]** | | [optional] -**arrayArrayOfInteger** | **[[Number]]** | | [optional] -**arrayArrayOfModel** | **[[ReadOnlyFirst]]** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Capitalization.md b/samples/client/petstore/javascript/docs/Capitalization.md deleted file mode 100644 index abeff984c6..0000000000 --- a/samples/client/petstore/javascript/docs/Capitalization.md +++ /dev/null @@ -1,13 +0,0 @@ -# OpenApiPetstore.Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Cat.md b/samples/client/petstore/javascript/docs/Cat.md deleted file mode 100644 index 6dd0f057c8..0000000000 --- a/samples/client/petstore/javascript/docs/Cat.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Boolean** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Category.md b/samples/client/petstore/javascript/docs/Category.md deleted file mode 100644 index e3f934442a..0000000000 --- a/samples/client/petstore/javascript/docs/Category.md +++ /dev/null @@ -1,9 +0,0 @@ -# OpenApiPetstore.Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Number** | | [optional] -**name** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/ClassModel.md b/samples/client/petstore/javascript/docs/ClassModel.md deleted file mode 100644 index 6fe9c501a5..0000000000 --- a/samples/client/petstore/javascript/docs/ClassModel.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Client.md b/samples/client/petstore/javascript/docs/Client.md deleted file mode 100644 index a6c7711e74..0000000000 --- a/samples/client/petstore/javascript/docs/Client.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Dog.md b/samples/client/petstore/javascript/docs/Dog.md deleted file mode 100644 index f35663407e..0000000000 --- a/samples/client/petstore/javascript/docs/Dog.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/EnumArrays.md b/samples/client/petstore/javascript/docs/EnumArrays.md deleted file mode 100644 index 5f624e5db4..0000000000 --- a/samples/client/petstore/javascript/docs/EnumArrays.md +++ /dev/null @@ -1,31 +0,0 @@ -# OpenApiPetstore.EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **[String]** | | [optional] - - - -## Enum: JustSymbolEnum - - -* `GREATER_THAN_OR_EQUAL_TO` (value: `">="`) - -* `DOLLAR` (value: `"$"`) - - - - - -## Enum: [ArrayEnumEnum] - - -* `fish` (value: `"fish"`) - -* `crab` (value: `"crab"`) - - - - diff --git a/samples/client/petstore/javascript/docs/EnumClass.md b/samples/client/petstore/javascript/docs/EnumClass.md deleted file mode 100644 index cef9bb57a5..0000000000 --- a/samples/client/petstore/javascript/docs/EnumClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# OpenApiPetstore.EnumClass - -## Enum - - -* `_abc` (value: `"_abc"`) - -* `-efg` (value: `"-efg"`) - -* `(xyz)` (value: `"(xyz)"`) - - diff --git a/samples/client/petstore/javascript/docs/EnumTest.md b/samples/client/petstore/javascript/docs/EnumTest.md deleted file mode 100644 index c9e7ce86fe..0000000000 --- a/samples/client/petstore/javascript/docs/EnumTest.md +++ /dev/null @@ -1,60 +0,0 @@ -# OpenApiPetstore.EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **Number** | | [optional] -**enumNumber** | **Number** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - - - -## Enum: EnumStringEnum - - -* `UPPER` (value: `"UPPER"`) - -* `lower` (value: `"lower"`) - -* `empty` (value: `""`) - - - - - -## Enum: EnumStringRequiredEnum - - -* `UPPER` (value: `"UPPER"`) - -* `lower` (value: `"lower"`) - -* `empty` (value: `""`) - - - - - -## Enum: EnumIntegerEnum - - -* `1` (value: `1`) - -* `-1` (value: `-1`) - - - - - -## Enum: EnumNumberEnum - - -* `1.1` (value: `1.1`) - -* `-1.2` (value: `-1.2`) - - - - diff --git a/samples/client/petstore/javascript/docs/FakeApi.md b/samples/client/petstore/javascript/docs/FakeApi.md deleted file mode 100644 index cf9654ab59..0000000000 --- a/samples/client/petstore/javascript/docs/FakeApi.md +++ /dev/null @@ -1,504 +0,0 @@ -# OpenApiPetstore.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | -[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters -[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data - - - -# **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(opts) - - - -Test serialization of outer boolean types - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var opts = { - 'body': true // Boolean | Input boolean as post body -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.fakeOuterBooleanSerialize(opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Boolean**| Input boolean as post body | [optional] - -### Return type - -**Boolean** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -# **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(opts) - - - -Test serialization of object with outer number type - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var opts = { - 'outerComposite': new OpenApiPetstore.OuterComposite() // OuterComposite | Input composite as post body -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.fakeOuterCompositeSerialize(opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -# **fakeOuterNumberSerialize** -> Number fakeOuterNumberSerialize(opts) - - - -Test serialization of outer number types - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var opts = { - 'body': 3.4 // Number | Input number as post body -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.fakeOuterNumberSerialize(opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Number**| Input number as post body | [optional] - -### Return type - -**Number** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -# **fakeOuterStringSerialize** -> String fakeOuterStringSerialize(opts) - - - -Test serialization of outer string types - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var opts = { - 'body': "body_example" // String | Input string as post body -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.fakeOuterStringSerialize(opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String**| Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - - -# **testBodyWithQueryParams** -> testBodyWithQueryParams(query, user) - - - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var query = "query_example"; // String | -var user = new OpenApiPetstore.User(); // User | -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.testBodyWithQueryParams(query, user, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String**| | - **user** | [**User**](User.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **testClientModel** -> Client testClientModel(client) - -To test \"client\" model - -To test \"client\" model - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var client = new OpenApiPetstore.Client(); // Client | client model -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.testClientModel(client, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -# **testEndpointParameters** -> testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; - -// Configure HTTP basic authorization: http_basic_test -var http_basic_test = defaultClient.authentications['http_basic_test']; -http_basic_test.username = 'YOUR USERNAME'; -http_basic_test.password = 'YOUR PASSWORD'; - -var apiInstance = new OpenApiPetstore.FakeApi(); -var _number = 3.4; // Number | None -var _double = 3.4; // Number | None -var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -var _byte = null; // Blob | None -var opts = { - 'integer': 56, // Number | None - 'int32': 56, // Number | None - 'int64': 789, // Number | None - '_float': 3.4, // Number | None - '_string': "_string_example", // String | None - 'binary': "/path/to/file", // File | None - '_date': new Date("2013-10-20"), // Date | None - 'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None - 'password': "password_example", // String | None - 'callback': "callback_example" // String | None -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **_number** | **Number**| None | - **_double** | **Number**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **Blob**| None | - **integer** | **Number**| None | [optional] - **int32** | **Number**| None | [optional] - **int64** | **Number**| None | [optional] - **_float** | **Number**| None | [optional] - **_string** | **String**| None | [optional] - **binary** | **File**| None | [optional] - **_date** | **Date**| None | [optional] - **dateTime** | **Date**| None | [optional] - **password** | **String**| None | [optional] - **callback** | **String**| None | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **testEnumParameters** -> testEnumParameters(opts) - -To test enum parameters - -To test enum parameters - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var opts = { - 'enumHeaderStringArray': ["'$'"], // [String] | Header parameter enum test (string array) - 'enumHeaderString': "'-efg'", // String | Header parameter enum test (string) - 'enumQueryStringArray': ["'$'"], // [String] | Query parameter enum test (string array) - 'enumQueryString': "'-efg'", // String | Query parameter enum test (string) - 'enumQueryInteger': 56, // Number | Query parameter enum test (double) - 'enumQueryDouble': 3.4, // Number | Query parameter enum test (double) - 'enumFormStringArray': "'$'", // [String] | Form parameter enum test (string array) - 'enumFormString': "'-efg'" // String | Form parameter enum test (string) -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.testEnumParameters(opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[String]**](String.md)| Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**[String]**](String.md)| Query parameter enum test (string array) | [optional] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryInteger** | **Number**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Number**| Query parameter enum test (double) | [optional] - **enumFormStringArray** | **[String]**| Form parameter enum test (string array) | [optional] [default to '$'] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **testInlineAdditionalProperties** -> testInlineAdditionalProperties(requestBody) - -test inline additionalProperties - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var requestBody = {key: "inner_example"}; // {String: String} | request body -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.testInlineAdditionalProperties(requestBody, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestBody** | [**{String: String}**](String.md)| request body | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **testJsonFormData** -> testJsonFormData(param, param2) - -test json serialization of form data - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.FakeApi(); -var param = "param_example"; // String | field1 -var param2 = "param2_example"; // String | field2 -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.testJsonFormData(param, param2, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - diff --git a/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 1d0a71149f..0000000000 --- a/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,58 +0,0 @@ -# OpenApiPetstore.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(client) - -To test class name in snake case - -To test class name in snake case - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure API key authorization: api_key_query -var api_key_query = defaultClient.authentications['api_key_query']; -api_key_query.apiKey = 'YOUR API KEY'; -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.apiKeyPrefix = 'Token'; - -var apiInstance = new OpenApiPetstore.FakeClassnameTags123Api(); -var client = new OpenApiPetstore.Client(); // Client | client model -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.testClassname(client, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/javascript/docs/FormatTest.md b/samples/client/petstore/javascript/docs/FormatTest.md deleted file mode 100644 index 0f4a840544..0000000000 --- a/samples/client/petstore/javascript/docs/FormatTest.md +++ /dev/null @@ -1,20 +0,0 @@ -# OpenApiPetstore.FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Number** | | [optional] -**int32** | **Number** | | [optional] -**int64** | **Number** | | [optional] -**_number** | **Number** | | -**_float** | **Number** | | [optional] -**_double** | **Number** | | [optional] -**_string** | **String** | | [optional] -**_byte** | **Blob** | | -**binary** | **File** | | [optional] -**_date** | **Date** | | -**dateTime** | **Date** | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | - - diff --git a/samples/client/petstore/javascript/docs/HasOnlyReadOnly.md b/samples/client/petstore/javascript/docs/HasOnlyReadOnly.md deleted file mode 100644 index abc4ce6218..0000000000 --- a/samples/client/petstore/javascript/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,9 +0,0 @@ -# OpenApiPetstore.HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**foo** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/List.md b/samples/client/petstore/javascript/docs/List.md deleted file mode 100644 index 3a9555e34e..0000000000 --- a/samples/client/petstore/javascript/docs/List.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/MapTest.md b/samples/client/petstore/javascript/docs/MapTest.md deleted file mode 100644 index 4a128da00f..0000000000 --- a/samples/client/petstore/javascript/docs/MapTest.md +++ /dev/null @@ -1,20 +0,0 @@ -# OpenApiPetstore.MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | **{String: {String: String}}** | | [optional] -**mapOfEnumString** | **{String: String}** | | [optional] - - - -## Enum: {String: String} - - -* `UPPER` (value: `"UPPER"`) - -* `lower` (value: `"lower"`) - - - - diff --git a/samples/client/petstore/javascript/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/javascript/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 051f771930..0000000000 --- a/samples/client/petstore/javascript/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,10 +0,0 @@ -# OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**dateTime** | **Date** | | [optional] -**map** | [**{String: Animal}**](Animal.md) | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Model200Response.md b/samples/client/petstore/javascript/docs/Model200Response.md deleted file mode 100644 index 0a0d02cc32..0000000000 --- a/samples/client/petstore/javascript/docs/Model200Response.md +++ /dev/null @@ -1,9 +0,0 @@ -# OpenApiPetstore.Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Number** | | [optional] -**_class** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/ModelReturn.md b/samples/client/petstore/javascript/docs/ModelReturn.md deleted file mode 100644 index 9ce6e20387..0000000000 --- a/samples/client/petstore/javascript/docs/ModelReturn.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.ModelReturn - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Number** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Name.md b/samples/client/petstore/javascript/docs/Name.md deleted file mode 100644 index 8dfcc46036..0000000000 --- a/samples/client/petstore/javascript/docs/Name.md +++ /dev/null @@ -1,11 +0,0 @@ -# OpenApiPetstore.Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Number** | | -**snakeCase** | **Number** | | [optional] -**property** | **String** | | [optional] -**_123number** | **Number** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/NumberOnly.md b/samples/client/petstore/javascript/docs/NumberOnly.md deleted file mode 100644 index cf84674ed4..0000000000 --- a/samples/client/petstore/javascript/docs/NumberOnly.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **Number** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/Order.md b/samples/client/petstore/javascript/docs/Order.md deleted file mode 100644 index 987992caa7..0000000000 --- a/samples/client/petstore/javascript/docs/Order.md +++ /dev/null @@ -1,26 +0,0 @@ -# OpenApiPetstore.Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Number** | | [optional] -**petId** | **Number** | | [optional] -**quantity** | **Number** | | [optional] -**shipDate** | **Date** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Boolean** | | [optional] [default to false] - - - -## Enum: StatusEnum - - -* `placed` (value: `"placed"`) - -* `approved` (value: `"approved"`) - -* `delivered` (value: `"delivered"`) - - - - diff --git a/samples/client/petstore/javascript/docs/OuterComposite.md b/samples/client/petstore/javascript/docs/OuterComposite.md deleted file mode 100644 index c49b32ff32..0000000000 --- a/samples/client/petstore/javascript/docs/OuterComposite.md +++ /dev/null @@ -1,10 +0,0 @@ -# OpenApiPetstore.OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **Number** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Boolean** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/OuterEnum.md b/samples/client/petstore/javascript/docs/OuterEnum.md deleted file mode 100644 index 445d3f4074..0000000000 --- a/samples/client/petstore/javascript/docs/OuterEnum.md +++ /dev/null @@ -1,12 +0,0 @@ -# OpenApiPetstore.OuterEnum - -## Enum - - -* `placed` (value: `"placed"`) - -* `approved` (value: `"approved"`) - -* `delivered` (value: `"delivered"`) - - diff --git a/samples/client/petstore/javascript/docs/Pet.md b/samples/client/petstore/javascript/docs/Pet.md deleted file mode 100644 index e91ae688aa..0000000000 --- a/samples/client/petstore/javascript/docs/Pet.md +++ /dev/null @@ -1,26 +0,0 @@ -# OpenApiPetstore.Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Number** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **[String]** | | -**tags** | [**[Tag]**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] - - - -## Enum: StatusEnum - - -* `available` (value: `"available"`) - -* `pending` (value: `"pending"`) - -* `sold` (value: `"sold"`) - - - - diff --git a/samples/client/petstore/javascript/docs/PetApi.md b/samples/client/petstore/javascript/docs/PetApi.md deleted file mode 100644 index fbcca8372c..0000000000 --- a/samples/client/petstore/javascript/docs/PetApi.md +++ /dev/null @@ -1,400 +0,0 @@ -# OpenApiPetstore.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **addPet** -> addPet(pet) - -Add a new pet to the store - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; - -var apiInstance = new OpenApiPetstore.PetApi(); -var pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.addPet(pet, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **deletePet** -> deletePet(petId, opts) - -Deletes a pet - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; - -var apiInstance = new OpenApiPetstore.PetApi(); -var petId = 789; // Number | Pet id to delete -var opts = { - 'apiKey': "apiKey_example" // String | -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.deletePet(petId, opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Number**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **findPetsByStatus** -> [Pet] findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; - -var apiInstance = new OpenApiPetstore.PetApi(); -var status = ["'available'"]; // [String] | Status values that need to be considered for filter -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.findPetsByStatus(status, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByTags** -> [Pet] findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; - -var apiInstance = new OpenApiPetstore.PetApi(); -var tags = ["inner_example"]; // [String] | Tags to filter by -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.findPetsByTags(tags, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md)| Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure API key authorization: api_key -var api_key = defaultClient.authentications['api_key']; -api_key.apiKey = 'YOUR API KEY'; -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.apiKeyPrefix = 'Token'; - -var apiInstance = new OpenApiPetstore.PetApi(); -var petId = 789; // Number | ID of pet to return -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.getPetById(petId, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Number**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updatePet** -> updatePet(pet) - -Update an existing pet - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; - -var apiInstance = new OpenApiPetstore.PetApi(); -var pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.updatePet(pet, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **updatePetWithForm** -> updatePetWithForm(petId, opts) - -Updates a pet in the store with form data - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; - -var apiInstance = new OpenApiPetstore.PetApi(); -var petId = 789; // Number | ID of pet that needs to be updated -var opts = { - 'name': "name_example", // String | Updated name of the pet - 'status': "status_example" // String | Updated status of the pet -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.updatePetWithForm(petId, opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Number**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **uploadFile** -> ApiResponse uploadFile(petId, opts) - -uploads an image - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure OAuth2 access token for authorization: petstore_auth -var petstore_auth = defaultClient.authentications['petstore_auth']; -petstore_auth.accessToken = 'YOUR ACCESS TOKEN'; - -var apiInstance = new OpenApiPetstore.PetApi(); -var petId = 789; // Number | ID of pet to update -var opts = { - 'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server - 'file': "/path/to/file" // File | file to upload -}; -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.uploadFile(petId, opts, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Number**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/petstore/javascript/docs/ReadOnlyFirst.md b/samples/client/petstore/javascript/docs/ReadOnlyFirst.md deleted file mode 100644 index 671280fba3..0000000000 --- a/samples/client/petstore/javascript/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,9 +0,0 @@ -# OpenApiPetstore.ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**baz** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/SpecialModelName.md b/samples/client/petstore/javascript/docs/SpecialModelName.md deleted file mode 100644 index 6039f53de3..0000000000 --- a/samples/client/petstore/javascript/docs/SpecialModelName.md +++ /dev/null @@ -1,8 +0,0 @@ -# OpenApiPetstore.SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Number** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/StoreApi.md b/samples/client/petstore/javascript/docs/StoreApi.md deleted file mode 100644 index 6f1e0816f0..0000000000 --- a/samples/client/petstore/javascript/docs/StoreApi.md +++ /dev/null @@ -1,184 +0,0 @@ -# OpenApiPetstore.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.StoreApi(); -var orderId = "orderId_example"; // String | ID of the order that needs to be deleted -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.deleteOrder(orderId, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **getInventory** -> {String: Number} getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); -var defaultClient = OpenApiPetstore.ApiClient.instance; -// Configure API key authorization: api_key -var api_key = defaultClient.authentications['api_key']; -api_key.apiKey = 'YOUR API KEY'; -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.apiKeyPrefix = 'Token'; - -var apiInstance = new OpenApiPetstore.StoreApi(); -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.getInventory(callback); -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{String: Number}** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.StoreApi(); -var orderId = 789; // Number | ID of pet that needs to be fetched -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.getOrderById(orderId, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Number**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **placeOrder** -> Order placeOrder(order) - -Place an order for a pet - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.StoreApi(); -var order = new OpenApiPetstore.Order(); // Order | order placed for purchasing the pet -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.placeOrder(order, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/javascript/docs/Tag.md b/samples/client/petstore/javascript/docs/Tag.md deleted file mode 100644 index a53941e80e..0000000000 --- a/samples/client/petstore/javascript/docs/Tag.md +++ /dev/null @@ -1,9 +0,0 @@ -# OpenApiPetstore.Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Number** | | [optional] -**name** | **String** | | [optional] - - diff --git a/samples/client/petstore/javascript/docs/User.md b/samples/client/petstore/javascript/docs/User.md deleted file mode 100644 index 2e86dd378b..0000000000 --- a/samples/client/petstore/javascript/docs/User.md +++ /dev/null @@ -1,15 +0,0 @@ -# OpenApiPetstore.User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Number** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Number** | User Status | [optional] - - diff --git a/samples/client/petstore/javascript/docs/UserApi.md b/samples/client/petstore/javascript/docs/UserApi.md deleted file mode 100644 index d75bf078ea..0000000000 --- a/samples/client/petstore/javascript/docs/UserApi.md +++ /dev/null @@ -1,350 +0,0 @@ -# OpenApiPetstore.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -# **createUser** -> createUser(user) - -Create user - -This can only be done by the logged in user. - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.UserApi(); -var user = new OpenApiPetstore.User(); // User | Created user object -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.createUser(user, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) - -Creates list of users with given input array - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.UserApi(); -var user = [new OpenApiPetstore.User()]; // [User] | List of user object -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.createUsersWithArrayInput(user, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**[User]**](Array.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **createUsersWithListInput** -> createUsersWithListInput(user) - -Creates list of users with given input array - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.UserApi(); -var user = [new OpenApiPetstore.User()]; // [User] | List of user object -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.createUsersWithListInput(user, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**[User]**](Array.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.UserApi(); -var username = "username_example"; // String | The name that needs to be deleted -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.deleteUser(username, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.UserApi(); -var username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.getUserByName(username, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.UserApi(); -var username = "username_example"; // String | The user name for login -var password = "password_example"; // String | The password for login in clear text -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); - } -}; -apiInstance.loginUser(username, password, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.UserApi(); -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.logoutUser(callback); -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **updateUser** -> updateUser(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example -```javascript -var OpenApiPetstore = require('open_api_petstore'); - -var apiInstance = new OpenApiPetstore.UserApi(); -var username = "username_example"; // String | name that need to be deleted -var user = new OpenApiPetstore.User(); // User | Updated user object -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully.'); - } -}; -apiInstance.updateUser(username, user, callback); -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - diff --git a/samples/client/petstore/javascript/src/model/EnumTest.js b/samples/client/petstore/javascript/src/model/EnumTest.js index 23e5ba124e..a1fa0b7514 100644 --- a/samples/client/petstore/javascript/src/model/EnumTest.js +++ b/samples/client/petstore/javascript/src/model/EnumTest.js @@ -79,7 +79,7 @@ obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number'); } if (data.hasOwnProperty('outerEnum')) { - obj['outerEnum'] = OuterEnum.constructFromObject(data['OuterEnum']); + obj['outerEnum'] = OuterEnum.constructFromObject(data['outerEnum']); } } return obj; diff --git a/samples/client/petstore/javascript/src/model/OuterComposite.js b/samples/client/petstore/javascript/src/model/OuterComposite.js index dd95c10060..cee1b9a083 100644 --- a/samples/client/petstore/javascript/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript/src/model/OuterComposite.js @@ -64,13 +64,13 @@ obj = obj || new exports(); if (data.hasOwnProperty('my_number')) { - obj['my_number'] = 'Number'.constructFromObject(data['Number']); + obj['my_number'] = 'Number'.constructFromObject(data['my_number']); } if (data.hasOwnProperty('my_string')) { - obj['my_string'] = 'String'.constructFromObject(data['String']); + obj['my_string'] = 'String'.constructFromObject(data['my_string']); } if (data.hasOwnProperty('my_boolean')) { - obj['my_boolean'] = 'Boolean'.constructFromObject(data['Boolean']); + obj['my_boolean'] = 'Boolean'.constructFromObject(data['my_boolean']); } } return obj; diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js index c904719c8d..ff1df0c02f 100644 --- a/samples/client/petstore/javascript/src/model/Pet.js +++ b/samples/client/petstore/javascript/src/model/Pet.js @@ -72,7 +72,7 @@ obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } if (data.hasOwnProperty('category')) { - obj['category'] = Category.constructFromObject(data['Category']); + obj['category'] = Category.constructFromObject(data['category']); } if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'String'); diff --git a/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js index ada97141e5..8ab4cba4fa 100644 --- a/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js +++ b/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js @@ -3,12 +3,11 @@ * 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 * - * OpenAPI Codegen version: 2.3.0-SNAPSHOT + * OpenAPI Generator version: 3.0.0-SNAPSHOT * * Do not edit the class manually. * @@ -23,15 +22,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.OpenAPIPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, OpenAPIPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new OpenAPIPetstore.AnotherFakeApi(); + instance = new OpenApiPetstore.AnotherFakeApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js index d5df4514d6..8f25ee4645 100644 --- a/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js +++ b/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js @@ -3,12 +3,11 @@ * 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 * - * OpenAPI Codegen version: 2.3.0-SNAPSHOT + * OpenAPI Generator version: 3.0.0-SNAPSHOT * * Do not edit the class manually. * @@ -23,15 +22,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.OpenAPIPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, OpenAPIPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new OpenAPIPetstore.FakeClassnameTags123Api(); + instance = new OpenApiPetstore.FakeClassnameTags123Api(); }); var getProperty = function(object, getter, property) {