Throw exception when config file missing (#4557)

* throw exception when config file missing

* fix bash config location
This commit is contained in:
William Cheng 2019-11-22 14:01:57 +08:00 committed by GitHub
parent de69eac316
commit 5c275bccd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 296 additions and 199 deletions

View File

@ -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

View File

@ -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;

View File

@ -1 +1 @@
4.2.0-SNAPSHOT
4.2.2-SNAPSHOT

View File

@ -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\

View File

@ -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

View File

@ -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=(
)

View File

@ -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)

View File

@ -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

View File

@ -15,7 +15,7 @@ Method | HTTP request | Description
### Example
```bash
fooGet
petstore-cli fooGet
```
### Parameters

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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='<api-key>'${OFF}"
echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u <username>:<password>' before ${YELLOW}<operation>${OFF}"
echo -e " or export ${RED}PETSTORE_BASIC_AUTH='<username>:<password>'${OFF}"
echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u <username>:<password>' before ${YELLOW}<operation>${OFF}"
echo -e " or export ${RED}PETSTORE_BASIC_AUTH='<username>:<password>'${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 <<EOF
${CYAN}call123TestSpecialTags${OFF};To test special tags
EOF
echo " $ops" | column -t -s ';'
echo ""
echo -e "${BOLD}${WHITE}[default]${OFF}"
read -r -d '' ops <<EOF
${CYAN}fooGet${OFF};
EOF
echo " $ops" | column -t -s ';'
echo ""
echo -e "${BOLD}${WHITE}[fake]${OFF}"
read -r -d '' ops <<EOF
${CYAN}createXmlItem${OFF};creates an XmlItem
${CYAN}fakeHealthGet${OFF};Health check endpoint
${CYAN}fakeOuterBooleanSerialize${OFF};
${CYAN}fakeOuterCompositeSerialize${OFF};
${CYAN}fakeOuterNumberSerialize${OFF};
@ -753,7 +760,7 @@ read -r -d '' ops <<EOF
偽のエンドポイント
가짜 엔드 포인트 (AUTH)
${CYAN}testEnumParameters${OFF};To test enum parameters
${CYAN}testGroupParameters${OFF};Fake endpoint to test group parameters (optional)
${CYAN}testGroupParameters${OFF};Fake endpoint to test group parameters (optional) (AUTH)
${CYAN}testInlineAdditionalProperties${OFF};test inline additionalProperties
${CYAN}testJsonFormData${OFF};test json serialization of form data
${CYAN}testQueryParameterCollectionFormat${OFF};
@ -873,22 +880,31 @@ print_call123TestSpecialTags_help() {
}
##############################################################################
#
# Print help for createXmlItem operation
# Print help for fooGet operation
#
##############################################################################
print_createXmlItem_help() {
print_fooGet_help() {
echo ""
echo -e "${BOLD}${WHITE}createXmlItem - creates an XmlItem${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e "${BOLD}${WHITE}fooGet - ${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo -e "this route creates an XmlItem" | paste -sd' ' | fold -sw 80
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/xml,application/xml; charset=utf-8,application/xml; charset=utf-16,text/xml,text/xml; charset=utf-8,text/xml; charset=utf-16]${OFF} ${RED}(required)${OFF}${OFF} - XmlItem Body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
code=0
echo -e "${result_color_table[${code:0:1}]} 0;response${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
}
##############################################################################
#
# Print help for fakeHealthGet operation
#
##############################################################################
print_fakeHealthGet_help() {
echo ""
echo -e "${BOLD}${WHITE}fakeHealthGet - Health check endpoint${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
code=200
echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
echo -e "${result_color_table[${code:0:1}]} 200;The instance started successfully${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
}
##############################################################################
#
@ -902,7 +918,7 @@ print_fakeOuterBooleanSerialize_help() {
echo -e "Test serialization of outer boolean types" | paste -sd' ' | fold -sw 80
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF}${OFF} - Input boolean as post body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF}${OFF} - Input boolean as post body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -921,7 +937,7 @@ print_fakeOuterCompositeSerialize_help() {
echo -e "Test serialization of object with outer number type" | paste -sd' ' | fold -sw 80
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF}${OFF} - Input composite as post body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF}${OFF} - Input composite as post body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -940,7 +956,7 @@ print_fakeOuterNumberSerialize_help() {
echo -e "Test serialization of outer number types" | paste -sd' ' | fold -sw 80
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF}${OFF} - Input number as post body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF}${OFF} - Input number as post body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -959,7 +975,7 @@ print_fakeOuterStringSerialize_help() {
echo -e "Test serialization of outer string types" | paste -sd' ' | fold -sw 80
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF}${OFF} - Input string as post body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF}${OFF} - Input string as post body" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -1062,7 +1078,7 @@ print_testEnumParameters_help() {
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}enum_header_string_array${OFF} ${BLUE}[array[string]]${OFF} ${CYAN}(default: null)${OFF} - Header parameter enum test (string array) ${YELLOW}Specify as: enum_header_string_array:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}enum_header_string${OFF} ${BLUE}[string]${OFF} ${CYAN}(default: -efg)${OFF} - Header parameter enum test (string) ${YELLOW}Specify as: enum_header_string:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}enum_query_string_array${OFF} ${BLUE}[array[string]]${OFF} ${CYAN}(default: null)${OFF} - Query parameter enum test (string array)${YELLOW} Specify as: enum_query_string_array="value1,value2,..."${OFF}" \
echo -e " * ${GREEN}enum_query_string_array${OFF} ${BLUE}[array[string]]${OFF} ${CYAN}(default: null)${OFF} - Query parameter enum test (string array)${YELLOW} Specify as: enum_query_string_array=value1 enum_query_string_array=value2 enum_query_string_array=...${OFF}" \
| paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}enum_query_string${OFF} ${BLUE}[string]${OFF} ${CYAN}(default: -efg)${OFF} - Query parameter enum test (string)${YELLOW} Specify as: enum_query_string=value${OFF}" \
| paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
@ -1084,7 +1100,7 @@ print_testEnumParameters_help() {
##############################################################################
print_testGroupParameters_help() {
echo ""
echo -e "${BOLD}${WHITE}testGroupParameters - Fake endpoint to test group parameters (optional)${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e "${BOLD}${WHITE}testGroupParameters - Fake endpoint to test group parameters (optional)${OFF}${BLUE}(AUTH - BASIC)${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo -e "Fake endpoint to test group parameters (optional)" | paste -sd' ' | fold -sw 80
echo -e ""
@ -1148,7 +1164,7 @@ print_testQueryParameterCollectionFormat_help() {
echo -e "To test the collection format in query parameters" | paste -sd' ' | fold -sw 80
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}pipe${OFF} ${BLUE}[array[string]]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - ${YELLOW} Specify as: pipe="value1,value2,..."${OFF}" \
echo -e " * ${GREEN}pipe${OFF} ${BLUE}[array[string]]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - ${YELLOW} Specify as: pipe=value1 pipe=value2 pipe=...${OFF}" \
| paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}ioutil${OFF} ${BLUE}[array[string]]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - ${YELLOW} Specify as: ioutil="value1,value2,..."${OFF}" \
| paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
@ -1196,8 +1212,6 @@ print_addPet_help() {
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
code=200
echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
code=405
echo -e "${result_color_table[${code:0:1}]} 405;Invalid input${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
}
@ -1215,8 +1229,6 @@ print_deletePet_help() {
echo -e " * ${GREEN}api_key${OFF} ${BLUE}[string]${OFF} ${CYAN}(default: null)${OFF} - ${YELLOW}Specify as: api_key:value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
code=200
echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
code=400
echo -e "${result_color_table[${code:0:1}]} 400;Invalid pet value${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
}
@ -1298,8 +1310,6 @@ print_updatePet_help() {
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
code=200
echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
code=400
echo -e "${result_color_table[${code:0:1}]} 400;Invalid ID supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
code=404
@ -1423,7 +1433,7 @@ print_placeOrder_help() {
echo -e "${BOLD}${WHITE}placeOrder - Place an order for a pet${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF} ${RED}(required)${OFF}${OFF} - order placed for purchasing the pet" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - order placed for purchasing the pet" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -1444,7 +1454,7 @@ print_createUser_help() {
echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF} ${RED}(required)${OFF}${OFF} - Created user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - Created user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -1461,7 +1471,7 @@ print_createUsersWithArrayInput_help() {
echo -e "${BOLD}${WHITE}createUsersWithArrayInput - Creates list of users with given input array${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF} ${RED}(required)${OFF}${OFF} - List of user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - List of user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -1478,7 +1488,7 @@ print_createUsersWithListInput_help() {
echo -e "${BOLD}${WHITE}createUsersWithListInput - Creates list of users with given input array${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF} ${RED}(required)${OFF}${OFF} - List of user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - List of user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -1576,7 +1586,7 @@ print_updateUser_help() {
echo -e ""
echo -e "${BOLD}${WHITE}Parameters${OFF}"
echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - name that need to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF} ${RED}(required)${OFF}${OFF} - Updated user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - Updated user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
echo -e ""
echo ""
echo -e "${BOLD}${WHITE}Responses${OFF}"
@ -1667,10 +1677,10 @@ call_call123TestSpecialTags() {
##############################################################################
#
# Call createXmlItem operation
# Call fooGet operation
#
##############################################################################
call_createXmlItem() {
call_fooGet() {
# ignore error about 'path_parameter_names' being unused; passed by reference
# shellcheck disable=SC2034
local path_parameter_names=()
@ -1679,11 +1689,11 @@ call_createXmlItem() {
local query_parameter_names=()
local path
if ! path=$(build_request_path "/v2/fake/create_xml_item" path_parameter_names query_parameter_names); then
if ! path=$(build_request_path "/v2/foo" path_parameter_names query_parameter_names); then
ERROR_MSG=$path
exit 1
fi
local method="POST"
local method="GET"
local headers_curl
headers_curl=$(header_arguments_to_curl)
if [[ -n $header_accept ]]; then
@ -1694,54 +1704,46 @@ call_createXmlItem() {
if [[ -n $basic_auth_credential ]]; then
basic_auth_option="-u ${basic_auth_credential}"
fi
local body_json_curl=""
#
# Check if the user provided 'Content-type' headers in the
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/xml"
echo -e "\\t- application/xml; charset=utf-8"
echo -e "\\t- application/xml; charset=utf-16"
echo -e "\\t- text/xml"
echo -e "\\t- text/xml; charset=utf-8"
echo -e "\\t- text/xml; charset=utf-16"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
if [[ "$print_curl" = true ]]; then
echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\""
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\""
fi
}
##############################################################################
#
# Call fakeHealthGet operation
#
##############################################################################
call_fakeHealthGet() {
# ignore error about 'path_parameter_names' being unused; passed by reference
# shellcheck disable=SC2034
local path_parameter_names=()
# ignore error about 'query_parameter_names' being unused; passed by reference
# shellcheck disable=SC2034
local query_parameter_names=()
local path
if ! path=$(build_request_path "/v2/fake/health" path_parameter_names query_parameter_names); then
ERROR_MSG=$path
exit 1
fi
local method="GET"
local headers_curl
headers_curl=$(header_arguments_to_curl)
if [[ -n $header_accept ]]; then
headers_curl="${headers_curl} -H 'Accept: ${header_accept}'"
fi
#
# If we have received some body content over pipe, pass it from the
# temporary file to cURL
#
if [[ -n $body_content_temp_file ]]; then
if [[ "$print_curl" = true ]]; then
echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-"
else
eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-"
fi
rm "${body_content_temp_file}"
#
# If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE
#
local basic_auth_option=""
if [[ -n $basic_auth_credential ]]; then
basic_auth_option="-u ${basic_auth_credential}"
fi
if [[ "$print_curl" = true ]]; then
echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\""
else
body_json_curl=$(body_parameters_to_json)
if [[ "$print_curl" = true ]]; then
echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\""
else
eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\""
fi
eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\""
fi
}
@ -1781,10 +1783,19 @@ call_fakeOuterBooleanSerialize() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -1850,10 +1861,19 @@ call_fakeOuterCompositeSerialize() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -1919,10 +1939,19 @@ call_fakeOuterNumberSerialize() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -1988,10 +2017,19 @@ call_fakeOuterStringSerialize() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -2338,7 +2376,7 @@ call_testGroupParameters() {
local path_parameter_names=()
# ignore error about 'query_parameter_names' being unused; passed by reference
# shellcheck disable=SC2034
local query_parameter_names=(required_string_group required_int64_group string_group int64_group)
local query_parameter_names=(required_string_group required_int64_group string_group int64_group )
local path
if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then
@ -3139,10 +3177,19 @@ call_placeOrder() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -3208,10 +3255,19 @@ call_createUser() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -3277,10 +3333,19 @@ call_createUsersWithArrayInput() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -3346,10 +3411,19 @@ call_createUsersWithListInput() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -3559,10 +3633,19 @@ call_updateUser() {
# command line. If not try to set them based on the OpenAPI specification
# if values produces and consumes are defined unambigously
#
if [[ -z $header_content_type ]]; then
header_content_type="application/json"
fi
if [[ -z $header_content_type && "$force" = false ]]; then
:
echo "ERROR: Request's content-type not specified!!!"
echo "This operation expects content-type in one of the following formats:"
echo -e "\\t- application/json"
echo ""
echo "Use '--content-type' to set proper content type"
exit 1
else
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
fi
@ -3692,8 +3775,11 @@ case $key in
call123TestSpecialTags)
operation="call123TestSpecialTags"
;;
createXmlItem)
operation="createXmlItem"
fooGet)
operation="fooGet"
;;
fakeHealthGet)
operation="fakeHealthGet"
;;
fakeOuterBooleanSerialize)
operation="fakeOuterBooleanSerialize"
@ -3887,8 +3973,11 @@ case $operation in
call123TestSpecialTags)
call_call123TestSpecialTags
;;
createXmlItem)
call_createXmlItem
fooGet)
call_fooGet
;;
fakeHealthGet)
call_fakeHealthGet
;;
fakeOuterBooleanSerialize)
call_fakeOuterBooleanSerialize

View File

@ -69,7 +69,8 @@ _petstore-cli()
# It's modelled as an associative array for efficient key lookup
declare -A operations
operations["call123TestSpecialTags"]=1
operations["createXmlItem"]=1
operations["fooGet"]=1
operations["fakeHealthGet"]=1
operations["fakeOuterBooleanSerialize"]=1
operations["fakeOuterCompositeSerialize"]=1
operations["fakeOuterNumberSerialize"]=1
@ -110,7 +111,8 @@ _petstore-cli()
# Only include path, query and header parameters
declare -A operation_parameters
operation_parameters["call123TestSpecialTags"]=""
operation_parameters["createXmlItem"]=""
operation_parameters["fooGet"]=""
operation_parameters["fakeHealthGet"]=""
operation_parameters["fakeOuterBooleanSerialize"]=""
operation_parameters["fakeOuterCompositeSerialize"]=""
operation_parameters["fakeOuterNumberSerialize"]=""