mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
update ruby samples by running the bin/ruby-petstore.sh
This commit is contained in:
parent
851f2ef688
commit
4a4151a751
@ -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-05-25T01:17:54.676+08:00
|
||||
- Build date: 2016-06-29T13:19:03.533-07:00
|
||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
@ -142,12 +142,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
|
||||
@ -157,3 +151,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
|
||||
|
||||
|
@ -3,5 +3,7 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**map_property** | **Hash<String, String>** | | [optional]
|
||||
**map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional]
|
||||
|
||||
|
||||
|
@ -3,5 +3,8 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**array_of_string** | **Array<String>** | | [optional]
|
||||
**array_array_of_integer** | **Array<Array<Integer>>** | | [optional]
|
||||
**array_array_of_model** | **Array<Array<ReadOnlyFirst>>** | | [optional]
|
||||
|
||||
|
||||
|
@ -5,5 +5,6 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**uuid** | **String** | | [optional]
|
||||
**date_time** | **DateTime** | | [optional]
|
||||
**map** | [**Hash<String, Animal>**](Animal.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -180,13 +180,6 @@ module Petstore
|
||||
# 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',
|
||||
@ -194,6 +187,13 @@ module Petstore
|
||||
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
|
||||
|
@ -26,15 +26,24 @@ require 'date'
|
||||
module Petstore
|
||||
|
||||
class AdditionalPropertiesClass
|
||||
attr_accessor :map_property
|
||||
|
||||
attr_accessor :map_of_map_property
|
||||
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'map_property' => :'map_property',
|
||||
:'map_of_map_property' => :'map_of_map_property'
|
||||
}
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.swagger_types
|
||||
{
|
||||
:'map_property' => :'Hash<String, String>',
|
||||
:'map_of_map_property' => :'Hash<String, Hash<String, String>>'
|
||||
}
|
||||
end
|
||||
|
||||
@ -46,6 +55,18 @@ module Petstore
|
||||
# convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||
|
||||
if attributes.has_key?(:'map_property')
|
||||
if (value = attributes[:'map_property']).is_a?(Array)
|
||||
self.map_property = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.has_key?(:'map_of_map_property')
|
||||
if (value = attributes[:'map_of_map_property']).is_a?(Array)
|
||||
self.map_of_map_property = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
@ -58,13 +79,16 @@ module Petstore
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
return true
|
||||
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
|
||||
self.class == o.class &&
|
||||
map_property == o.map_property &&
|
||||
map_of_map_property == o.map_of_map_property
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
@ -76,7 +100,7 @@ module Petstore
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Fixnum] Hash code
|
||||
def hash
|
||||
[].hash
|
||||
[map_property, map_of_map_property].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
|
@ -26,15 +26,28 @@ require 'date'
|
||||
module Petstore
|
||||
|
||||
class ArrayTest
|
||||
attr_accessor :array_of_string
|
||||
|
||||
attr_accessor :array_array_of_integer
|
||||
|
||||
attr_accessor :array_array_of_model
|
||||
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'array_of_string' => :'array_of_string',
|
||||
:'array_array_of_integer' => :'array_array_of_integer',
|
||||
:'array_array_of_model' => :'array_array_of_model'
|
||||
}
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.swagger_types
|
||||
{
|
||||
:'array_of_string' => :'Array<String>',
|
||||
:'array_array_of_integer' => :'Array<Array<Integer>>',
|
||||
:'array_array_of_model' => :'Array<Array<ReadOnlyFirst>>'
|
||||
}
|
||||
end
|
||||
|
||||
@ -46,6 +59,24 @@ module Petstore
|
||||
# convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||
|
||||
if attributes.has_key?(:'array_of_string')
|
||||
if (value = attributes[:'array_of_string']).is_a?(Array)
|
||||
self.array_of_string = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.has_key?(:'array_array_of_integer')
|
||||
if (value = attributes[:'array_array_of_integer']).is_a?(Array)
|
||||
self.array_array_of_integer = value
|
||||
end
|
||||
end
|
||||
|
||||
if attributes.has_key?(:'array_array_of_model')
|
||||
if (value = attributes[:'array_array_of_model']).is_a?(Array)
|
||||
self.array_array_of_model = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
@ -58,13 +89,17 @@ module Petstore
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
return true
|
||||
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
|
||||
self.class == o.class &&
|
||||
array_of_string == o.array_of_string &&
|
||||
array_array_of_integer == o.array_array_of_integer &&
|
||||
array_array_of_model == o.array_array_of_model
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
@ -76,7 +111,7 @@ module Petstore
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Fixnum] Hash code
|
||||
def hash
|
||||
[].hash
|
||||
[array_of_string, array_array_of_integer, array_array_of_model].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
|
@ -30,11 +30,15 @@ module Petstore
|
||||
|
||||
attr_accessor :date_time
|
||||
|
||||
attr_accessor :map
|
||||
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'uuid' => :'uuid',
|
||||
:'date_time' => :'dateTime'
|
||||
:'date_time' => :'dateTime',
|
||||
:'map' => :'map'
|
||||
}
|
||||
end
|
||||
|
||||
@ -42,7 +46,8 @@ module Petstore
|
||||
def self.swagger_types
|
||||
{
|
||||
:'uuid' => :'String',
|
||||
:'date_time' => :'DateTime'
|
||||
:'date_time' => :'DateTime',
|
||||
:'map' => :'Hash<String, Animal>'
|
||||
}
|
||||
end
|
||||
|
||||
@ -62,6 +67,12 @@ module Petstore
|
||||
self.date_time = attributes[:'dateTime']
|
||||
end
|
||||
|
||||
if attributes.has_key?(:'map')
|
||||
if (value = attributes[:'map']).is_a?(Array)
|
||||
self.map = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
@ -74,6 +85,7 @@ module Petstore
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
return true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
@ -82,7 +94,8 @@ module Petstore
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
uuid == o.uuid &&
|
||||
date_time == o.date_time
|
||||
date_time == o.date_time &&
|
||||
map == o.map
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
@ -94,7 +107,7 @@ module Petstore
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Fixnum] Hash code
|
||||
def hash
|
||||
[uuid, date_time].hash
|
||||
[uuid, date_time, map].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
|
@ -30,6 +30,7 @@ module Petstore
|
||||
|
||||
attr_accessor :baz
|
||||
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
@ -74,6 +75,7 @@ module Petstore
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
return true
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
|
Loading…
Reference in New Issue
Block a user