diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 126db11d8a4..c033e2bc601 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -155,6 +155,12 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + ## http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md index 2e4654a0feb..d5fe15b46fc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/Fake_classname_tags123Api.md @@ -17,6 +17,11 @@ To test class name in snake case setApiKey('api_key_query', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key_query', 'Bearer'); + $api_instance = new Swagger\Client\Api\Fake_classname_tags123Api(new \Http\Adapter\Guzzle6\Client()); $body = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model @@ -41,7 +46,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[api_key_query](../../README.md#api_key_query) ### HTTP request headers diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php index 6687f851f1b..a6f2f939ecc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php @@ -283,6 +283,11 @@ class Fake_classname_tags123Api } } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_key_query'); + if ($apiKey !== null) { + $queryParams['api_key_query'] = $apiKey; + } $query = \GuzzleHttp\Psr7\build_query($queryParams); $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 0ac1c9df25d..4903f762470 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -155,6 +155,12 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + ### http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md index c8f005d8d3b..cecdf785dfd 100644 --- a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md @@ -16,6 +16,13 @@ To test class name in snake case ```ruby # load the gem require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure API key authorization: api_key_query + config.api_key['api_key_query'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api_key_query'] = 'Bearer' +end api_instance = Petstore::FakeClassnameTags123Api.new @@ -43,7 +50,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[api_key_query](../README.md#api_key_query) ### HTTP request headers diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 2778d7714c7..f8da951d061 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -61,7 +61,7 @@ module Petstore # http body (model) post_body = @api_client.object_to_http_body(body) - auth_names = [] + auth_names = ['api_key_query'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 37fdb07ca49..19b9c30f700 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -203,6 +203,13 @@ module Petstore key: 'api_key', value: api_key_with_prefix('api_key') }, + 'api_key_query' => + { + type: 'api_key', + in: 'query', + key: 'api_key_query', + value: api_key_with_prefix('api_key_query') + }, 'http_basic_test' => { type: 'basic',