Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ module {{moduleName}}
# Update hearder and query params based on authentication settings.
#
# @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
def update_params_for_auth!(header_params, query_params, auth_names)
Array(auth_names).each do |auth_name|
Expand Down
14 changes: 7 additions & 7 deletions samples/client/petstore/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/

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

## Installation
Expand Down Expand Up @@ -137,12 +137,6 @@ Class | Method | HTTP request | Description
## Documentation for Authorization


### api_key

- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header

### petstore_auth

- **Type**: OAuth
Expand All @@ -152,3 +146,9 @@ Class | Method | HTTP request | Description
- write:pets: modify pets in your account
- read:pets: read your pets

### api_key

- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header

2 changes: 1 addition & 1 deletion samples/client/petstore/ruby/docs/EnumArrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**just_enum** | **String** | | [optional]
**just_symbol** | **String** | | [optional]
**array_enum** | **Array<String>** | | [optional]


2 changes: 1 addition & 1 deletion samples/client/petstore/ruby/lib/petstore/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def build_request_body(header_params, form_params, body)
# Update hearder and query params based on authentication settings.
#
# @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
def update_params_for_auth!(header_params, query_params, auth_names)
Array(auth_names).each do |auth_name|
Expand Down
14 changes: 7 additions & 7 deletions samples/client/petstore/ruby/lib/petstore/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,20 +201,20 @@ def basic_auth_token
# Returns Auth Settings hash for api client.
def auth_settings
{
'api_key' =>
{
type: 'api_key',
in: 'header',
key: 'api_key',
value: api_key_with_prefix('api_key')
},
'petstore_auth' =>
{
type: 'oauth2',
in: 'header',
key: 'Authorization',
value: "Bearer #{access_token}"
},
'api_key' =>
{
type: 'api_key',
in: 'header',
key: 'api_key',
value: api_key_with_prefix('api_key')
},
}
end
end
Expand Down
30 changes: 15 additions & 15 deletions samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
module Petstore

class EnumArrays
attr_accessor :just_enum
attr_accessor :just_symbol

attr_accessor :array_enum

Expand Down Expand Up @@ -55,15 +55,15 @@ def valid?(value)
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'just_enum' => :'just_enum',
:'just_symbol' => :'just_symbol',
:'array_enum' => :'array_enum'
}
end

# Attribute type mapping.
def self.swagger_types
{
:'just_enum' => :'String',
:'just_symbol' => :'String',
:'array_enum' => :'Array<String>'
}
end
Expand All @@ -76,8 +76,8 @@ def initialize(attributes = {})
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

if attributes.has_key?(:'just_enum')
self.just_enum = attributes[:'just_enum']
if attributes.has_key?(:'just_symbol')
self.just_symbol = attributes[:'just_symbol']
end

if attributes.has_key?(:'array_enum')
Expand All @@ -98,27 +98,27 @@ def list_invalid_properties
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
just_enum_validator = EnumAttributeValidator.new('String', ["bird", "eagle"])
return false unless just_enum_validator.valid?(@just_enum)
just_symbol_validator = EnumAttributeValidator.new('String', [">=", "$"])
return false unless just_symbol_validator.valid?(@just_symbol)
return true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] just_enum Object to be assigned
def just_enum=(just_enum)
validator = EnumAttributeValidator.new('String', ["bird", "eagle"])
unless validator.valid?(just_enum)
fail ArgumentError, "invalid value for 'just_enum', must be one of #{validator.allowable_values}."
# @param [Object] just_symbol Object to be assigned
def just_symbol=(just_symbol)
validator = EnumAttributeValidator.new('String', [">=", "$"])
unless validator.valid?(just_symbol)
fail ArgumentError, "invalid value for 'just_symbol', must be one of #{validator.allowable_values}."
end
@just_enum = just_enum
@just_symbol = just_symbol
end

# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
just_enum == o.just_enum &&
just_symbol == o.just_symbol &&
array_enum == o.array_enum
end

Expand All @@ -131,7 +131,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
[just_enum, array_enum].hash
[just_symbol, array_enum].hash
end

# Builds the object from hash
Expand Down