From 5c275bccd249e79ae6113057b5b14c47bd0c8b73 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 22 Nov 2019 14:01:57 +0800 Subject: [PATCH] Throw exception when config file missing (#4557) * throw exception when config file missing * fix bash config location --- bin/openapi3/bash-petstore.sh | 2 +- .../codegen/config/CodegenConfigurator.java | 3 +- .../petstore/bash/.openapi-generator/VERSION | 2 +- samples/client/petstore/bash/Dockerfile | 1 + samples/client/petstore/bash/README.md | 32 +- samples/client/petstore/bash/_petstore-cli | 10 +- .../bash/docs/AdditionalPropertiesClass.md | 13 +- .../petstore/bash/docs/AnotherFakeApi.md | 2 +- .../client/petstore/bash/docs/DefaultApi.md | 2 +- samples/client/petstore/bash/docs/EnumTest.md | 3 + samples/client/petstore/bash/docs/FakeApi.md | 45 +-- .../bash/docs/FakeClassnameTags123Api.md | 2 +- .../client/petstore/bash/docs/FormatTest.md | 3 +- samples/client/petstore/bash/docs/PetApi.md | 4 +- samples/client/petstore/bash/docs/StoreApi.md | 4 +- samples/client/petstore/bash/docs/UserApi.md | 16 +- samples/client/petstore/bash/petstore-cli | 345 +++++++++++------- .../bash/petstore-cli.bash-completion | 6 +- 18 files changed, 296 insertions(+), 199 deletions(-) diff --git a/bin/openapi3/bash-petstore.sh b/bin/openapi3/bash-petstore.sh index a25e348dffa..d247da5b8a0 100755 --- a/bin/openapi3/bash-petstore.sh +++ b/bin/openapi3/bash-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/bash -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g bash -o samples/client/petstore/bash -c modules/openapi-generator/src/test/resources/3_0/bash-config.json --additional-properties hideGenerationTimestamp=true $@" +args="generate -t modules/openapi-generator/src/main/resources/bash -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g bash -o samples/client/petstore/bash -c modules/openapi-generator/src/test/resources/2_0/bash-config.json --additional-properties hideGenerationTimestamp=true $@" java $JAVA_OPTS -jar $executable $args diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index 46f74f54738..f19f8d1bf58 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -135,7 +135,8 @@ public class CodegenConfigurator { return configurator; } catch (IOException ex) { - LOGGER.error("Unable to deserialize config file: " + configFile, ex); + LOGGER.error(ex.getMessage()); + throw new RuntimeException("Unable to deserialize config file: " + configFile); } } return null; diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index c3a2c7076fa..e4955748d3e 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/bash/Dockerfile b/samples/client/petstore/bash/Dockerfile index ee17f324a5c..77df27f3661 100644 --- a/samples/client/petstore/bash/Dockerfile +++ b/samples/client/petstore/bash/Dockerfile @@ -41,6 +41,7 @@ $(tput setaf 3)PETSTORE_HOST$(tput sgr0) - server URL, e.g. https://example.com: $(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ $(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ $(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ +$(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ \n\ $(tput setaf 7)Basic usage:$(tput sgr0)\n\ \n\ diff --git a/samples/client/petstore/bash/README.md b/samples/client/petstore/bash/README.md index ddef9718509..8179fa5a2a9 100644 --- a/samples/client/petstore/bash/README.md +++ b/samples/client/petstore/bash/README.md @@ -101,7 +101,8 @@ All URIs are relative to */v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -144,16 +145,8 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [$special[modelName]](docs/$special[modelName].md) - [200Response](docs/200Response.md) - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Animal](docs/Animal.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) @@ -171,23 +164,34 @@ Class | Method | HTTP request | Description - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Return](docs/Return.md) + - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) ## Documentation For Authorization @@ -207,6 +211,10 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key_query - **Location**: URL query string +## bearer_test + +- **Type**: HTTP basic authentication + ## http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index a4000b479d7..323b934de07 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -296,7 +296,7 @@ case $state in ops) # Operations _values "Operations" \ - "call123TestSpecialTags[To test special tags]" "createXmlItem[creates an XmlItem]" \ + "call123TestSpecialTags[To test special tags]" "fooGet[]" "fakeHealthGet[Health check endpoint]" \ "fakeOuterBooleanSerialize[]" \ "fakeOuterCompositeSerialize[]" \ "fakeOuterNumberSerialize[]" \ @@ -343,7 +343,13 @@ case $state in ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; - createXmlItem) + fooGet) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeHealthGet) local -a _op_arguments _op_arguments=( ) diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md index 5b1ed2dce63..0b452819e9e 100644 --- a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md @@ -3,17 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mapUnderscorestring** | **map[String, string]** | | [optional] [default to null] -**mapUnderscorenumber** | **map[String, integer]** | | [optional] [default to null] -**mapUnderscoreinteger** | **map[String, integer]** | | [optional] [default to null] -**mapUnderscoreboolean** | **map[String, boolean]** | | [optional] [default to null] -**mapUnderscorearrayUnderscoreinteger** | **map[String, array[integer]]** | | [optional] [default to null] -**mapUnderscorearrayUnderscoreanytype** | **map[String, array[map]]** | | [optional] [default to null] -**mapUnderscoremapUnderscorestring** | **map[String, map[String, string]]** | | [optional] [default to null] -**mapUnderscoremapUnderscoreanytype** | **map[String, map[String, map]]** | | [optional] [default to null] -**anytypeUnderscore1** | [**map**](.md) | | [optional] [default to null] -**anytypeUnderscore2** | [**map**](.md) | | [optional] [default to null] -**anytypeUnderscore3** | [**map**](.md) | | [optional] [default to null] +**mapUnderscoreproperty** | **map[String, string]** | | [optional] [default to null] +**mapUnderscoreofUnderscoremapUnderscoreproperty** | **map[String, map[String, string]]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/AnotherFakeApi.md b/samples/client/petstore/bash/docs/AnotherFakeApi.md index e17a9e75d00..8eda10a2508 100644 --- a/samples/client/petstore/bash/docs/AnotherFakeApi.md +++ b/samples/client/petstore/bash/docs/AnotherFakeApi.md @@ -25,7 +25,7 @@ petstore-cli call123TestSpecialTags Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/bash/docs/DefaultApi.md b/samples/client/petstore/bash/docs/DefaultApi.md index 5ef9511145b..faecfcefe3b 100644 --- a/samples/client/petstore/bash/docs/DefaultApi.md +++ b/samples/client/petstore/bash/docs/DefaultApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description ### Example ```bash - fooGet +petstore-cli fooGet ``` ### Parameters diff --git a/samples/client/petstore/bash/docs/EnumTest.md b/samples/client/petstore/bash/docs/EnumTest.md index 30b30efa730..3f70a0a0667 100644 --- a/samples/client/petstore/bash/docs/EnumTest.md +++ b/samples/client/petstore/bash/docs/EnumTest.md @@ -8,6 +8,9 @@ Name | Type | Description | Notes **enumUnderscoreinteger** | **integer** | | [optional] [default to null] **enumUnderscorenumber** | **float** | | [optional] [default to null] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [default to null] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] [default to null] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to null] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/FakeApi.md b/samples/client/petstore/bash/docs/FakeApi.md index 0b14173e0e6..905f6e2cd08 100644 --- a/samples/client/petstore/bash/docs/FakeApi.md +++ b/samples/client/petstore/bash/docs/FakeApi.md @@ -4,7 +4,7 @@ All URIs are relative to */v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -24,28 +24,23 @@ Method | HTTP request | Description -## createXmlItem +## fakeHealthGet -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example ```bash -petstore-cli createXmlItem +petstore-cli fakeHealthGet ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xmlItem** | [**XmlItem**](XmlItem.md) | XmlItem Body | +This endpoint does not need any parameter. ### Return type -(empty response body) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -53,8 +48,8 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 -- **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -88,7 +83,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -111,7 +106,7 @@ petstore-cli fakeOuterCompositeSerialize Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] ### Return type @@ -123,7 +118,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -158,7 +153,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -193,7 +188,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -216,7 +211,7 @@ petstore-cli testBodyWithFileSchema Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | ### Return type @@ -250,7 +245,7 @@ petstore-cli testBodyWithQueryParams query=value Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string** | | [default to null] - **body** | [**User**](User.md) | | + **user** | [**User**](User.md) | | ### Return type @@ -285,7 +280,7 @@ petstore-cli testClientModel Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type @@ -366,7 +361,7 @@ To test enum parameters ### Example ```bash -petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array="value1,value2,..." enum_query_string=value enum_query_integer=value enum_query_double=value +petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array=value1 enum_query_string_array=value2 enum_query_string_array=... enum_query_string=value enum_query_integer=value enum_query_double=value ``` ### Parameters @@ -429,7 +424,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers @@ -454,7 +449,7 @@ petstore-cli testInlineAdditionalProperties Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**map[String, string]**](string.md) | request body | + **requestBody** | [**map[String, string]**](string.md) | request body | ### Return type @@ -515,7 +510,7 @@ To test the collection format in query parameters ### Example ```bash -petstore-cli testQueryParameterCollectionFormat Specify as: pipe="value1,value2,..." Specify as: ioutil="value1,value2,..." Specify as: Specify as: url="value1,value2,..." Specify as: context=value1 context=value2 context=... +petstore-cli testQueryParameterCollectionFormat Specify as: pipe=value1 pipe=value2 pipe=... Specify as: ioutil="value1,value2,..." Specify as: Specify as: url="value1,value2,..." Specify as: context=value1 context=value2 context=... ``` ### Parameters diff --git a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md index 19b3d386d38..f670ef5f7b9 100644 --- a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md @@ -25,7 +25,7 @@ petstore-cli testClassname Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/bash/docs/FormatTest.md b/samples/client/petstore/bash/docs/FormatTest.md index 385631d820c..8fe26118a9d 100644 --- a/samples/client/petstore/bash/docs/FormatTest.md +++ b/samples/client/petstore/bash/docs/FormatTest.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **dateTime** | **string** | | [optional] [default to null] **uuid** | **string** | | [optional] [default to null] **password** | **string** | | [default to null] -**BigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional] [default to null] +**patternUnderscorewithUnderscoredigits** | **string** | | [optional] [default to null] +**patternUnderscorewithUnderscoredigitsUnderscoreandUnderscoredelimiter** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/PetApi.md b/samples/client/petstore/bash/docs/PetApi.md index 32086308206..ddc4f21bffc 100644 --- a/samples/client/petstore/bash/docs/PetApi.md +++ b/samples/client/petstore/bash/docs/PetApi.md @@ -31,7 +31,7 @@ petstore-cli addPet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -203,7 +203,7 @@ petstore-cli updatePet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/bash/docs/StoreApi.md b/samples/client/petstore/bash/docs/StoreApi.md index 56b2934562b..58ee002b7b8 100644 --- a/samples/client/petstore/bash/docs/StoreApi.md +++ b/samples/client/petstore/bash/docs/StoreApi.md @@ -128,7 +128,7 @@ petstore-cli placeOrder Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | + **order** | [**Order**](Order.md) | order placed for purchasing the pet | ### Return type @@ -140,7 +140,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/UserApi.md b/samples/client/petstore/bash/docs/UserApi.md index 9663a425b73..f36e39d38ee 100644 --- a/samples/client/petstore/bash/docs/UserApi.md +++ b/samples/client/petstore/bash/docs/UserApi.md @@ -32,7 +32,7 @@ petstore-cli createUser Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | + **user** | [**User**](User.md) | Created user object | ### Return type @@ -44,7 +44,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -65,7 +65,7 @@ petstore-cli createUsersWithArrayInput Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**array[User]**](User.md) | List of user object | + **user** | [**array[User]**](User.md) | List of user object | ### Return type @@ -77,7 +77,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -98,7 +98,7 @@ petstore-cli createUsersWithListInput Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**array[User]**](User.md) | List of user object | + **user** | [**array[User]**](User.md) | List of user object | ### Return type @@ -110,7 +110,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -266,7 +266,7 @@ petstore-cli updateUser username=value Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string** | name that need to be deleted | [default to null] - **body** | [**User**](User.md) | Updated user object | + **user** | [**User**](User.md) | Updated user object | ### Return type @@ -278,7 +278,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index 17891dc77b4..acbc3cd8a1b 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -1,4 +1,5 @@ #!/usr/bin/env bash + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # ! # ! Note: @@ -9,6 +10,7 @@ # ! # ! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # # This is a Bash client for OpenAPI Petstore. # @@ -93,16 +95,15 @@ declare -a result_color_table=( "$WHITE" "$WHITE" "$GREEN" "$YELLOW" "$WHITE" "$ # 0 - optional # 1 - required declare -A operation_parameters_minimum_occurrences -operation_parameters_minimum_occurrences["call123TestSpecialTags:::body"]=1 -operation_parameters_minimum_occurrences["createXmlItem:::XmlItem"]=1 +operation_parameters_minimum_occurrences["call123TestSpecialTags:::Client"]=1 operation_parameters_minimum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::body"]=0 +operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 operation_parameters_minimum_occurrences["fakeOuterNumberSerialize:::body"]=0 operation_parameters_minimum_occurrences["fakeOuterStringSerialize:::body"]=0 -operation_parameters_minimum_occurrences["testBodyWithFileSchema:::body"]=1 +operation_parameters_minimum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=1 operation_parameters_minimum_occurrences["testBodyWithQueryParams:::query"]=1 -operation_parameters_minimum_occurrences["testBodyWithQueryParams:::body"]=1 -operation_parameters_minimum_occurrences["testClientModel:::body"]=1 +operation_parameters_minimum_occurrences["testBodyWithQueryParams:::User"]=1 +operation_parameters_minimum_occurrences["testClientModel:::Client"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::number"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::double"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=1 @@ -131,7 +132,7 @@ operation_parameters_minimum_occurrences["testGroupParameters:::required_int64_g operation_parameters_minimum_occurrences["testGroupParameters:::string_group"]=0 operation_parameters_minimum_occurrences["testGroupParameters:::boolean_group"]=0 operation_parameters_minimum_occurrences["testGroupParameters:::int64_group"]=0 -operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::param"]=1 +operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::request_body"]=1 operation_parameters_minimum_occurrences["testJsonFormData:::param"]=1 operation_parameters_minimum_occurrences["testJsonFormData:::param2"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::pipe"]=1 @@ -139,14 +140,14 @@ operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::i operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::http"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::url"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::context"]=1 -operation_parameters_minimum_occurrences["testClassname:::body"]=1 -operation_parameters_minimum_occurrences["addPet:::body"]=1 +operation_parameters_minimum_occurrences["testClassname:::Client"]=1 +operation_parameters_minimum_occurrences["addPet:::Pet"]=1 operation_parameters_minimum_occurrences["deletePet:::petId"]=1 operation_parameters_minimum_occurrences["deletePet:::api_key"]=0 operation_parameters_minimum_occurrences["findPetsByStatus:::status"]=1 operation_parameters_minimum_occurrences["findPetsByTags:::tags"]=1 operation_parameters_minimum_occurrences["getPetById:::petId"]=1 -operation_parameters_minimum_occurrences["updatePet:::body"]=1 +operation_parameters_minimum_occurrences["updatePet:::Pet"]=1 operation_parameters_minimum_occurrences["updatePetWithForm:::petId"]=1 operation_parameters_minimum_occurrences["updatePetWithForm:::name"]=0 operation_parameters_minimum_occurrences["updatePetWithForm:::status"]=0 @@ -158,16 +159,16 @@ operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::requiredF operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 operation_parameters_minimum_occurrences["deleteOrder:::order_id"]=1 operation_parameters_minimum_occurrences["getOrderById:::order_id"]=1 -operation_parameters_minimum_occurrences["placeOrder:::body"]=1 -operation_parameters_minimum_occurrences["createUser:::body"]=1 -operation_parameters_minimum_occurrences["createUsersWithArrayInput:::body"]=1 -operation_parameters_minimum_occurrences["createUsersWithListInput:::body"]=1 +operation_parameters_minimum_occurrences["placeOrder:::Order"]=1 +operation_parameters_minimum_occurrences["createUser:::User"]=1 +operation_parameters_minimum_occurrences["createUsersWithArrayInput:::User"]=1 +operation_parameters_minimum_occurrences["createUsersWithListInput:::User"]=1 operation_parameters_minimum_occurrences["deleteUser:::username"]=1 operation_parameters_minimum_occurrences["getUserByName:::username"]=1 operation_parameters_minimum_occurrences["loginUser:::username"]=1 operation_parameters_minimum_occurrences["loginUser:::password"]=1 operation_parameters_minimum_occurrences["updateUser:::username"]=1 -operation_parameters_minimum_occurrences["updateUser:::body"]=1 +operation_parameters_minimum_occurrences["updateUser:::User"]=1 ## # This array stores the maximum number of allowed occurrences for parameter @@ -176,16 +177,15 @@ operation_parameters_minimum_occurrences["updateUser:::body"]=1 # N - N values # 0 - unlimited declare -A operation_parameters_maximum_occurrences -operation_parameters_maximum_occurrences["call123TestSpecialTags:::body"]=0 -operation_parameters_maximum_occurrences["createXmlItem:::XmlItem"]=0 +operation_parameters_maximum_occurrences["call123TestSpecialTags:::Client"]=0 operation_parameters_maximum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::body"]=0 +operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 operation_parameters_maximum_occurrences["fakeOuterNumberSerialize:::body"]=0 operation_parameters_maximum_occurrences["fakeOuterStringSerialize:::body"]=0 -operation_parameters_maximum_occurrences["testBodyWithFileSchema:::body"]=0 +operation_parameters_maximum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=0 operation_parameters_maximum_occurrences["testBodyWithQueryParams:::query"]=0 -operation_parameters_maximum_occurrences["testBodyWithQueryParams:::body"]=0 -operation_parameters_maximum_occurrences["testClientModel:::body"]=0 +operation_parameters_maximum_occurrences["testBodyWithQueryParams:::User"]=0 +operation_parameters_maximum_occurrences["testClientModel:::Client"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::number"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::double"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=0 @@ -214,7 +214,7 @@ operation_parameters_maximum_occurrences["testGroupParameters:::required_int64_g operation_parameters_maximum_occurrences["testGroupParameters:::string_group"]=0 operation_parameters_maximum_occurrences["testGroupParameters:::boolean_group"]=0 operation_parameters_maximum_occurrences["testGroupParameters:::int64_group"]=0 -operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::param"]=0 +operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::request_body"]=0 operation_parameters_maximum_occurrences["testJsonFormData:::param"]=0 operation_parameters_maximum_occurrences["testJsonFormData:::param2"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::pipe"]=0 @@ -222,14 +222,14 @@ operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::i operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::http"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::url"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::context"]=0 -operation_parameters_maximum_occurrences["testClassname:::body"]=0 -operation_parameters_maximum_occurrences["addPet:::body"]=0 +operation_parameters_maximum_occurrences["testClassname:::Client"]=0 +operation_parameters_maximum_occurrences["addPet:::Pet"]=0 operation_parameters_maximum_occurrences["deletePet:::petId"]=0 operation_parameters_maximum_occurrences["deletePet:::api_key"]=0 operation_parameters_maximum_occurrences["findPetsByStatus:::status"]=0 operation_parameters_maximum_occurrences["findPetsByTags:::tags"]=0 operation_parameters_maximum_occurrences["getPetById:::petId"]=0 -operation_parameters_maximum_occurrences["updatePet:::body"]=0 +operation_parameters_maximum_occurrences["updatePet:::Pet"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::petId"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::name"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::status"]=0 @@ -241,31 +241,30 @@ operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::requiredF operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 operation_parameters_maximum_occurrences["deleteOrder:::order_id"]=0 operation_parameters_maximum_occurrences["getOrderById:::order_id"]=0 -operation_parameters_maximum_occurrences["placeOrder:::body"]=0 -operation_parameters_maximum_occurrences["createUser:::body"]=0 -operation_parameters_maximum_occurrences["createUsersWithArrayInput:::body"]=0 -operation_parameters_maximum_occurrences["createUsersWithListInput:::body"]=0 +operation_parameters_maximum_occurrences["placeOrder:::Order"]=0 +operation_parameters_maximum_occurrences["createUser:::User"]=0 +operation_parameters_maximum_occurrences["createUsersWithArrayInput:::User"]=0 +operation_parameters_maximum_occurrences["createUsersWithListInput:::User"]=0 operation_parameters_maximum_occurrences["deleteUser:::username"]=0 operation_parameters_maximum_occurrences["getUserByName:::username"]=0 operation_parameters_maximum_occurrences["loginUser:::username"]=0 operation_parameters_maximum_occurrences["loginUser:::password"]=0 operation_parameters_maximum_occurrences["updateUser:::username"]=0 -operation_parameters_maximum_occurrences["updateUser:::body"]=0 +operation_parameters_maximum_occurrences["updateUser:::User"]=0 ## # The type of collection for specifying multiple values for parameter: # - multi, csv, ssv, tsv declare -A operation_parameters_collection_type -operation_parameters_collection_type["call123TestSpecialTags:::body"]="" -operation_parameters_collection_type["createXmlItem:::XmlItem"]="" +operation_parameters_collection_type["call123TestSpecialTags:::Client"]="" operation_parameters_collection_type["fakeOuterBooleanSerialize:::body"]="" -operation_parameters_collection_type["fakeOuterCompositeSerialize:::body"]="" +operation_parameters_collection_type["fakeOuterCompositeSerialize:::OuterComposite"]="" operation_parameters_collection_type["fakeOuterNumberSerialize:::body"]="" operation_parameters_collection_type["fakeOuterStringSerialize:::body"]="" -operation_parameters_collection_type["testBodyWithFileSchema:::body"]="" +operation_parameters_collection_type["testBodyWithFileSchema:::FileSchemaTestClass"]="" operation_parameters_collection_type["testBodyWithQueryParams:::query"]="" -operation_parameters_collection_type["testBodyWithQueryParams:::body"]="" -operation_parameters_collection_type["testClientModel:::body"]="" +operation_parameters_collection_type["testBodyWithQueryParams:::User"]="" +operation_parameters_collection_type["testClientModel:::Client"]="" operation_parameters_collection_type["testEndpointParameters:::number"]="" operation_parameters_collection_type["testEndpointParameters:::double"]="" operation_parameters_collection_type["testEndpointParameters:::pattern_without_delimiter"]="" @@ -282,7 +281,7 @@ operation_parameters_collection_type["testEndpointParameters:::password"]="" operation_parameters_collection_type["testEndpointParameters:::callback"]="" operation_parameters_collection_type["testEnumParameters:::enum_header_string_array"]="csv" operation_parameters_collection_type["testEnumParameters:::enum_header_string"]="" -operation_parameters_collection_type["testEnumParameters:::enum_query_string_array"]="csv" +operation_parameters_collection_type["testEnumParameters:::enum_query_string_array"]="multi" operation_parameters_collection_type["testEnumParameters:::enum_query_string"]="" operation_parameters_collection_type["testEnumParameters:::enum_query_integer"]="" operation_parameters_collection_type["testEnumParameters:::enum_query_double"]="" @@ -294,22 +293,22 @@ operation_parameters_collection_type["testGroupParameters:::required_int64_group operation_parameters_collection_type["testGroupParameters:::string_group"]="" operation_parameters_collection_type["testGroupParameters:::boolean_group"]="" operation_parameters_collection_type["testGroupParameters:::int64_group"]="" -operation_parameters_collection_type["testInlineAdditionalProperties:::param"]= +operation_parameters_collection_type["testInlineAdditionalProperties:::request_body"]= operation_parameters_collection_type["testJsonFormData:::param"]="" operation_parameters_collection_type["testJsonFormData:::param2"]="" -operation_parameters_collection_type["testQueryParameterCollectionFormat:::pipe"]="csv" +operation_parameters_collection_type["testQueryParameterCollectionFormat:::pipe"]="multi" operation_parameters_collection_type["testQueryParameterCollectionFormat:::ioutil"]="csv" operation_parameters_collection_type["testQueryParameterCollectionFormat:::http"]= operation_parameters_collection_type["testQueryParameterCollectionFormat:::url"]="csv" operation_parameters_collection_type["testQueryParameterCollectionFormat:::context"]="multi" -operation_parameters_collection_type["testClassname:::body"]="" -operation_parameters_collection_type["addPet:::body"]="" +operation_parameters_collection_type["testClassname:::Client"]="" +operation_parameters_collection_type["addPet:::Pet"]="" operation_parameters_collection_type["deletePet:::petId"]="" operation_parameters_collection_type["deletePet:::api_key"]="" operation_parameters_collection_type["findPetsByStatus:::status"]="csv" operation_parameters_collection_type["findPetsByTags:::tags"]="csv" operation_parameters_collection_type["getPetById:::petId"]="" -operation_parameters_collection_type["updatePet:::body"]="" +operation_parameters_collection_type["updatePet:::Pet"]="" operation_parameters_collection_type["updatePetWithForm:::petId"]="" operation_parameters_collection_type["updatePetWithForm:::name"]="" operation_parameters_collection_type["updatePetWithForm:::status"]="" @@ -321,16 +320,16 @@ operation_parameters_collection_type["uploadFileWithRequiredFile:::requiredFile" operation_parameters_collection_type["uploadFileWithRequiredFile:::additionalMetadata"]="" operation_parameters_collection_type["deleteOrder:::order_id"]="" operation_parameters_collection_type["getOrderById:::order_id"]="" -operation_parameters_collection_type["placeOrder:::body"]="" -operation_parameters_collection_type["createUser:::body"]="" -operation_parameters_collection_type["createUsersWithArrayInput:::body"]= -operation_parameters_collection_type["createUsersWithListInput:::body"]= +operation_parameters_collection_type["placeOrder:::Order"]="" +operation_parameters_collection_type["createUser:::User"]="" +operation_parameters_collection_type["createUsersWithArrayInput:::User"]= +operation_parameters_collection_type["createUsersWithListInput:::User"]= operation_parameters_collection_type["deleteUser:::username"]="" operation_parameters_collection_type["getUserByName:::username"]="" operation_parameters_collection_type["loginUser:::username"]="" operation_parameters_collection_type["loginUser:::password"]="" operation_parameters_collection_type["updateUser:::username"]="" -operation_parameters_collection_type["updateUser:::body"]="" +operation_parameters_collection_type["updateUser:::User"]="" ## @@ -723,6 +722,8 @@ EOF echo -e " or export ${RED}PETSTORE_API_KEY=''${OFF}" echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" echo -e " or export ${RED}PETSTORE_BASIC_AUTH=':'${OFF}" + echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" + echo -e " or export ${RED}PETSTORE_BASIC_AUTH=':'${OFF}" echo -e " - ${MAGENTA}OAuth2 (flow: implicit)${OFF}" echo -e " Authorization URL: " echo -e " * http://petstore.swagger.io/api/oauth/dialog" @@ -736,11 +737,17 @@ EOF read -r -d '' ops <