forked from loafle/openapi-generator-original
Fix unknown parameter on api_client's update_params_for_auth method.
This commit is contained in:
@@ -271,7 +271,7 @@ module {{moduleName}}
|
|||||||
# Update hearder and query params based on authentication settings.
|
# Update hearder and query params based on authentication settings.
|
||||||
#
|
#
|
||||||
# @param [Hash] header_params Header parameters
|
# @param [Hash] header_params Header parameters
|
||||||
# @param [Hash] form_params Query parameters
|
# @param [Hash] query_params Query parameters
|
||||||
# @param [String] auth_names Authentication scheme name
|
# @param [String] auth_names Authentication scheme name
|
||||||
def update_params_for_auth!(header_params, query_params, auth_names)
|
def update_params_for_auth!(header_params, query_params, auth_names)
|
||||||
Array(auth_names).each do |auth_name|
|
Array(auth_names).each do |auth_name|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-08-03T00:39:31.384+08:00
|
- Build date: 2016-08-09T19:11:03.532+10:00
|
||||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@@ -137,12 +137,6 @@ Class | Method | HTTP request | Description
|
|||||||
## Documentation for Authorization
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
|
||||||
### api_key
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: api_key
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
### petstore_auth
|
### petstore_auth
|
||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
@@ -152,3 +146,9 @@ Class | Method | HTTP request | Description
|
|||||||
- write:pets: modify pets in your account
|
- write:pets: modify pets in your account
|
||||||
- read:pets: read your pets
|
- read:pets: read your pets
|
||||||
|
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**just_enum** | **String** | | [optional]
|
**just_symbol** | **String** | | [optional]
|
||||||
**array_enum** | **Array<String>** | | [optional]
|
**array_enum** | **Array<String>** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ module Petstore
|
|||||||
# Update hearder and query params based on authentication settings.
|
# Update hearder and query params based on authentication settings.
|
||||||
#
|
#
|
||||||
# @param [Hash] header_params Header parameters
|
# @param [Hash] header_params Header parameters
|
||||||
# @param [Hash] form_params Query parameters
|
# @param [Hash] query_params Query parameters
|
||||||
# @param [String] auth_names Authentication scheme name
|
# @param [String] auth_names Authentication scheme name
|
||||||
def update_params_for_auth!(header_params, query_params, auth_names)
|
def update_params_for_auth!(header_params, query_params, auth_names)
|
||||||
Array(auth_names).each do |auth_name|
|
Array(auth_names).each do |auth_name|
|
||||||
|
|||||||
@@ -201,13 +201,6 @@ module Petstore
|
|||||||
# Returns Auth Settings hash for api client.
|
# Returns Auth Settings hash for api client.
|
||||||
def auth_settings
|
def auth_settings
|
||||||
{
|
{
|
||||||
'api_key' =>
|
|
||||||
{
|
|
||||||
type: 'api_key',
|
|
||||||
in: 'header',
|
|
||||||
key: 'api_key',
|
|
||||||
value: api_key_with_prefix('api_key')
|
|
||||||
},
|
|
||||||
'petstore_auth' =>
|
'petstore_auth' =>
|
||||||
{
|
{
|
||||||
type: 'oauth2',
|
type: 'oauth2',
|
||||||
@@ -215,6 +208,13 @@ module Petstore
|
|||||||
key: 'Authorization',
|
key: 'Authorization',
|
||||||
value: "Bearer #{access_token}"
|
value: "Bearer #{access_token}"
|
||||||
},
|
},
|
||||||
|
'api_key' =>
|
||||||
|
{
|
||||||
|
type: 'api_key',
|
||||||
|
in: 'header',
|
||||||
|
key: 'api_key',
|
||||||
|
value: api_key_with_prefix('api_key')
|
||||||
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ require 'date'
|
|||||||
module Petstore
|
module Petstore
|
||||||
|
|
||||||
class EnumArrays
|
class EnumArrays
|
||||||
attr_accessor :just_enum
|
attr_accessor :just_symbol
|
||||||
|
|
||||||
attr_accessor :array_enum
|
attr_accessor :array_enum
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ module Petstore
|
|||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
def self.attribute_map
|
def self.attribute_map
|
||||||
{
|
{
|
||||||
:'just_enum' => :'just_enum',
|
:'just_symbol' => :'just_symbol',
|
||||||
:'array_enum' => :'array_enum'
|
:'array_enum' => :'array_enum'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -63,7 +63,7 @@ module Petstore
|
|||||||
# Attribute type mapping.
|
# Attribute type mapping.
|
||||||
def self.swagger_types
|
def self.swagger_types
|
||||||
{
|
{
|
||||||
:'just_enum' => :'String',
|
:'just_symbol' => :'String',
|
||||||
:'array_enum' => :'Array<String>'
|
:'array_enum' => :'Array<String>'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -76,8 +76,8 @@ module Petstore
|
|||||||
# convert string to symbol for hash key
|
# convert string to symbol for hash key
|
||||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||||
|
|
||||||
if attributes.has_key?(:'just_enum')
|
if attributes.has_key?(:'just_symbol')
|
||||||
self.just_enum = attributes[:'just_enum']
|
self.just_symbol = attributes[:'just_symbol']
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes.has_key?(:'array_enum')
|
if attributes.has_key?(:'array_enum')
|
||||||
@@ -98,19 +98,19 @@ module Petstore
|
|||||||
# Check to see if the all the properties in the model are valid
|
# Check to see if the all the properties in the model are valid
|
||||||
# @return true if the model is valid
|
# @return true if the model is valid
|
||||||
def valid?
|
def valid?
|
||||||
just_enum_validator = EnumAttributeValidator.new('String', ["bird", "eagle"])
|
just_symbol_validator = EnumAttributeValidator.new('String', [">=", "$"])
|
||||||
return false unless just_enum_validator.valid?(@just_enum)
|
return false unless just_symbol_validator.valid?(@just_symbol)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute writer method checking allowed values (enum).
|
# Custom attribute writer method checking allowed values (enum).
|
||||||
# @param [Object] just_enum Object to be assigned
|
# @param [Object] just_symbol Object to be assigned
|
||||||
def just_enum=(just_enum)
|
def just_symbol=(just_symbol)
|
||||||
validator = EnumAttributeValidator.new('String', ["bird", "eagle"])
|
validator = EnumAttributeValidator.new('String', [">=", "$"])
|
||||||
unless validator.valid?(just_enum)
|
unless validator.valid?(just_symbol)
|
||||||
fail ArgumentError, "invalid value for 'just_enum', must be one of #{validator.allowable_values}."
|
fail ArgumentError, "invalid value for 'just_symbol', must be one of #{validator.allowable_values}."
|
||||||
end
|
end
|
||||||
@just_enum = just_enum
|
@just_symbol = just_symbol
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks equality by comparing each attribute.
|
# Checks equality by comparing each attribute.
|
||||||
@@ -118,7 +118,7 @@ module Petstore
|
|||||||
def ==(o)
|
def ==(o)
|
||||||
return true if self.equal?(o)
|
return true if self.equal?(o)
|
||||||
self.class == o.class &&
|
self.class == o.class &&
|
||||||
just_enum == o.just_enum &&
|
just_symbol == o.just_symbol &&
|
||||||
array_enum == o.array_enum
|
array_enum == o.array_enum
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ module Petstore
|
|||||||
# Calculates hash code according to all attributes.
|
# Calculates hash code according to all attributes.
|
||||||
# @return [Fixnum] Hash code
|
# @return [Fixnum] Hash code
|
||||||
def hash
|
def hash
|
||||||
[just_enum, array_enum].hash
|
[just_symbol, array_enum].hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# Builds the object from hash
|
# Builds the object from hash
|
||||||
|
|||||||
Reference in New Issue
Block a user