update php, ruby petstore

This commit is contained in:
wing328 2017-08-02 23:38:46 +08:00
parent 8c487d5dbe
commit 54d00084f7
7 changed files with 39 additions and 3 deletions

View File

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

View File

@ -17,6 +17,11 @@ To test class name in snake case
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key_query
Swagger\Client\Configuration::getDefaultConfiguration()->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

View File

@ -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 : '');

View File

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

View File

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

View File

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

View File

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