mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
update samples
This commit is contained in:
@@ -419,7 +419,6 @@ Class | Method | HTTP request | Description
|
||||
*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
*FakeApi* | [**test_nullable**](docs/FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property
|
||||
*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
|
||||
*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map
|
||||
*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
|
||||
@@ -30,7 +30,6 @@ Method | HTTP request | Description
|
||||
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
[**test_nullable**](FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property
|
||||
[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
|
||||
[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map
|
||||
|
||||
|
||||
# **fake_big_decimal_map**
|
||||
@@ -1055,48 +1054,3 @@ No authorization required
|
||||
|
||||
[[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)
|
||||
|
||||
# **test_string_map_reference**
|
||||
> test_string_map_reference(request_body => $request_body)
|
||||
|
||||
test referenced string map
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```perl
|
||||
use Data::Dumper;
|
||||
use WWW::OpenAPIClient::FakeApi;
|
||||
my $api_instance = WWW::OpenAPIClient::FakeApi->new(
|
||||
);
|
||||
|
||||
my $request_body = WWW::OpenAPIClient::Object::HASH[string,string]->new(); # HASH[string,string] | request body
|
||||
|
||||
eval {
|
||||
$api_instance->test_string_map_reference(request_body => $request_body);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling FakeApi->test_string_map_reference: $@\n";
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**request_body** | [**HASH[string,string]**](string.md)| request body |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[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)
|
||||
|
||||
|
||||
@@ -1756,65 +1756,4 @@ sub test_query_parameter_collection_format {
|
||||
return;
|
||||
}
|
||||
|
||||
#
|
||||
# test_string_map_reference
|
||||
#
|
||||
# test referenced string map
|
||||
#
|
||||
# @param HASH[string,string] $request_body request body (required)
|
||||
{
|
||||
my $params = {
|
||||
'request_body' => {
|
||||
data_type => 'HASH[string,string]',
|
||||
description => 'request body',
|
||||
required => '1',
|
||||
},
|
||||
};
|
||||
__PACKAGE__->method_documentation->{ 'test_string_map_reference' } = {
|
||||
summary => 'test referenced string map',
|
||||
params => $params,
|
||||
returns => undef,
|
||||
};
|
||||
}
|
||||
# @return void
|
||||
#
|
||||
sub test_string_map_reference {
|
||||
my ($self, %args) = @_;
|
||||
|
||||
# verify the required parameter 'request_body' is set
|
||||
unless (exists $args{'request_body'}) {
|
||||
croak("Missing the required parameter 'request_body' when calling test_string_map_reference");
|
||||
}
|
||||
|
||||
# parse inputs
|
||||
my $_resource_path = '/fake/stringMap-reference';
|
||||
|
||||
my $_method = 'POST';
|
||||
my $query_params = {};
|
||||
my $header_params = {};
|
||||
my $form_params = {};
|
||||
|
||||
# 'Accept' and 'Content-Type' header
|
||||
my $_header_accept = $self->{api_client}->select_header_accept();
|
||||
if ($_header_accept) {
|
||||
$header_params->{'Accept'} = $_header_accept;
|
||||
}
|
||||
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
|
||||
|
||||
my $_body_data;
|
||||
# body params
|
||||
if ( exists $args{'request_body'}) {
|
||||
$_body_data = $args{'request_body'};
|
||||
}
|
||||
|
||||
# authentication setting, if any
|
||||
my $auth_settings = [qw()];
|
||||
|
||||
# make the API Call
|
||||
$self->{api_client}->call_api($_resource_path, $_method,
|
||||
$query_params, $form_params,
|
||||
$header_params, $_body_data, $auth_settings);
|
||||
return;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -2997,9 +2997,9 @@ export const FakeApiFp = function(configuration?: Configuration) {
|
||||
*/
|
||||
async testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.testStringMapReference(requestBody, options);
|
||||
const index = configuration?.serverIndex ?? 0;
|
||||
const operationBasePath = operationServerMap['FakeApi.testStringMapReference']?.[index]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['FakeApi.testStringMapReference']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2653,9 +2653,9 @@ export const FakeApiFp = function(configuration?: Configuration) {
|
||||
*/
|
||||
async testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.testStringMapReference(requestBody, options);
|
||||
const index = configuration?.serverIndex ?? 0;
|
||||
const operationBasePath = operationServerMap['FakeApi.testStringMapReference']?.[index]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['FakeApi.testStringMapReference']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
* To test unique items in header and query parameters
|
||||
|
||||
@@ -889,4 +889,32 @@ public class FakeApiMockServer {
|
||||
|
||||
|
||||
|
||||
public static MappingBuilder stubTestStringMapReference200(@javax.annotation.Nonnull String body) {
|
||||
MappingBuilder stub = post(urlPathEqualTo("/fake/stringMap-reference"))
|
||||
.withRequestBody(equalToJson(body))
|
||||
.willReturn(aResponse()
|
||||
.withStatus(200)
|
||||
);
|
||||
|
||||
|
||||
return stub;
|
||||
}
|
||||
|
||||
public static MappingBuilder stubTestStringMapReferenceFault(@javax.annotation.Nonnull String body, Fault fault) {
|
||||
MappingBuilder stub = post(urlPathEqualTo("/fake/stringMap-reference"))
|
||||
.withRequestBody(equalToJson(body))
|
||||
.willReturn(aResponse()
|
||||
.withFault(fault)
|
||||
);
|
||||
|
||||
|
||||
return stub;
|
||||
}
|
||||
|
||||
|
||||
public static String testStringMapReferenceRequestSample1() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user