[Ruby] use hasConsumes, hasProduces in ruby client (#4310)

* use hasConsumes, hasProduces in ruby client

* add new ruby files
This commit is contained in:
wing328
2016-12-02 17:22:46 +08:00
committed by GitHub
parent fdb6d3020c
commit 31d31b9466
15 changed files with 354 additions and 164 deletions

View File

@@ -125,14 +125,14 @@ module {{moduleName}}
# header parameters
header_params = {}
{{#hasProduces}}
# HTTP header 'Accept' (if needed)
local_header_accept = [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
header_params['Accept'] = @api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}])
{{/hasProduces}}
{{#hasConsumes}}
# HTTP header 'Content-Type'
local_header_content_type = [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Content-Type'] = @api_client.select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}])
{{/hasConsumes}}
{{#headerParams}}
{{#required}}
header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}}

View File

@@ -111,6 +111,7 @@ Class | Method | HTTP request | Description
- [Petstore::ArrayTest](docs/ArrayTest.md)
- [Petstore::Cat](docs/Cat.md)
- [Petstore::Category](docs/Category.md)
- [Petstore::ClassModel](docs/ClassModel.md)
- [Petstore::Client](docs/Client.md)
- [Petstore::Dog](docs/Dog.md)
- [Petstore::EnumArrays](docs/EnumArrays.md)
@@ -126,6 +127,7 @@ Class | Method | HTTP request | Description
- [Petstore::Name](docs/Name.md)
- [Petstore::NumberOnly](docs/NumberOnly.md)
- [Petstore::Order](docs/Order.md)
- [Petstore::OuterEnum](docs/OuterEnum.md)
- [Petstore::Pet](docs/Pet.md)
- [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Petstore::SpecialModelName](docs/SpecialModelName.md)

View File

@@ -0,0 +1,8 @@
# Petstore::ClassModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_class** | **String** | | [optional]

View File

@@ -6,5 +6,6 @@ Name | Type | Description | Notes
**enum_string** | **String** | | [optional]
**enum_integer** | **Integer** | | [optional]
**enum_number** | **Float** | | [optional]
**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]

View File

@@ -0,0 +1,7 @@
# Petstore::OuterEnum
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@@ -25,6 +25,7 @@ require 'petstore/models/array_of_number_only'
require 'petstore/models/array_test'
require 'petstore/models/cat'
require 'petstore/models/category'
require 'petstore/models/class_model'
require 'petstore/models/client'
require 'petstore/models/dog'
require 'petstore/models/enum_arrays'
@@ -40,6 +41,7 @@ require 'petstore/models/model_return'
require 'petstore/models/name'
require 'petstore/models/number_only'
require 'petstore/models/order'
require 'petstore/models/outer_enum'
require 'petstore/models/pet'
require 'petstore/models/read_only_first'
require 'petstore/models/special_model_name'

View File

@@ -48,14 +48,10 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
local_header_content_type = ['application/json']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters
form_params = {}
@@ -189,14 +185,10 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
header_params['Accept'] = @api_client.select_header_accept(['application/xml; charset=utf-8', 'application/json; charset=utf-8'])
# HTTP header 'Content-Type'
local_header_content_type = ['application/xml; charset=utf-8', 'application/json; charset=utf-8']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml; charset=utf-8', 'application/json; charset=utf-8'])
# form parameters
form_params = {}
@@ -292,14 +284,10 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['*/*']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
# HTTP header 'Content-Type'
local_header_content_type = ['*/*']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Content-Type'] = @api_client.select_header_content_type(['*/*'])
header_params[:'enum_header_string_array'] = @api_client.build_collection_param(opts[:'enum_header_string_array'], :csv) if !opts[:'enum_header_string_array'].nil?
header_params[:'enum_header_string'] = opts[:'enum_header_string'] if !opts[:'enum_header_string'].nil?

View File

@@ -48,14 +48,10 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# HTTP header 'Content-Type'
local_header_content_type = ['application/json', 'application/xml']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml'])
# form parameters
form_params = {}
@@ -106,14 +102,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
header_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil?
# form parameters
@@ -164,14 +154,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -222,14 +206,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -279,14 +257,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -336,14 +308,10 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# HTTP header 'Content-Type'
local_header_content_type = ['application/json', 'application/xml']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml'])
# form parameters
form_params = {}
@@ -396,14 +364,10 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# HTTP header 'Content-Type'
local_header_content_type = ['application/x-www-form-urlencoded']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
# form parameters
form_params = {}
@@ -458,14 +422,10 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
local_header_content_type = ['multipart/form-data']
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
# form parameters
form_params = {}

View File

@@ -52,14 +52,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -104,14 +98,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = {}
@@ -169,14 +157,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -226,14 +208,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}

View File

@@ -48,14 +48,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -104,14 +98,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -160,14 +148,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -216,14 +198,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -272,14 +248,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -335,14 +305,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -388,14 +352,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}
@@ -448,14 +406,8 @@ module Petstore
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
local_header_accept = ['application/xml', 'application/json']
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
# HTTP header 'Content-Type'
local_header_content_type = []
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
# form parameters
form_params = {}

View File

@@ -0,0 +1,187 @@
=begin
#Swagger Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
=end
require 'date'
module Petstore
# Model for testing model with \"_class\" property
class ClassModel
attr_accessor :_class
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'_class' => :'_class'
}
end
# Attribute type mapping.
def self.swagger_types
{
:'_class' => :'String'
}
end
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
return unless attributes.is_a?(Hash)
# convert string to symbol for hash key
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
if attributes.has_key?(:'_class')
self._class = attributes[:'_class']
end
end
# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properies with the reasons
def list_invalid_properties
invalid_properties = Array.new
return invalid_properties
end
# 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 &&
_class == o._class
end
# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
self == o
end
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
[_class].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself
def build_from_hash(attributes)
return nil unless attributes.is_a?(Hash)
self.class.swagger_types.each_pair do |key, type|
if type =~ /\AArray<(.*)>/i
# check to ensure the input is an array given that the the attribute
# is documented as an array but the input is not
if attributes[self.class.attribute_map[key]].is_a?(Array)
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
end
elsif !attributes[self.class.attribute_map[key]].nil?
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
end # or else data not found in attributes(hash), not an issue as the data can be optional
end
self
end
# Deserializes the data based on type
# @param string type Data type
# @param string value Value to be deserialized
# @return [Object] Deserialized data
def _deserialize(type, value)
case type.to_sym
when :DateTime
DateTime.parse(value)
when :Date
Date.parse(value)
when :String
value.to_s
when :Integer
value.to_i
when :Float
value.to_f
when :BOOLEAN
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
false
end
when :Object
# generic object (usually a Hash), return directly
value
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
k_type = Regexp.last_match[:k_type]
v_type = Regexp.last_match[:v_type]
{}.tap do |hash|
value.each do |k, v|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
end
end
else # model
temp_model = Petstore.const_get(type).new
temp_model.build_from_hash(value)
end
end
# Returns the string representation of the object
# @return [String] String presentation of the object
def to_s
to_hash.to_s
end
# to_body is an alias to to_hash (backward compatibility)
# @return [Hash] Returns the object in the form of hash
def to_body
to_hash
end
# Returns the object in the form of hash
# @return [Hash] Returns the object in the form of hash
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
hash[param] = _to_hash(value)
end
hash
end
# Outputs non-array value in the form of hash
# For object, use to_hash. Otherwise, just return the value
# @param [Object] value Any valid value
# @return [Hash] Returns the value in the form of hash
def _to_hash(value)
if value.is_a?(Array)
value.compact.map{ |v| _to_hash(v) }
elsif value.is_a?(Hash)
{}.tap do |hash|
value.each { |k, v| hash[k] = _to_hash(v) }
end
elsif value.respond_to? :to_hash
value.to_hash
else
value
end
end
end
end

View File

@@ -20,6 +20,8 @@ module Petstore
attr_accessor :enum_number
attr_accessor :outer_enum
class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
@@ -47,7 +49,8 @@ module Petstore
{
:'enum_string' => :'enum_string',
:'enum_integer' => :'enum_integer',
:'enum_number' => :'enum_number'
:'enum_number' => :'enum_number',
:'outer_enum' => :'outerEnum'
}
end
@@ -56,7 +59,8 @@ module Petstore
{
:'enum_string' => :'String',
:'enum_integer' => :'Integer',
:'enum_number' => :'Float'
:'enum_number' => :'Float',
:'outer_enum' => :'OuterEnum'
}
end
@@ -80,6 +84,10 @@ module Petstore
self.enum_number = attributes[:'enum_number']
end
if attributes.has_key?(:'outerEnum')
self.outer_enum = attributes[:'outerEnum']
end
end
# Show invalid properties with the reasons. Usually used together with valid?
@@ -138,7 +146,8 @@ module Petstore
self.class == o.class &&
enum_string == o.enum_string &&
enum_integer == o.enum_integer &&
enum_number == o.enum_number
enum_number == o.enum_number &&
outer_enum == o.outer_enum
end
# @see the `==` method
@@ -150,7 +159,7 @@ module Petstore
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
[enum_string, enum_integer, enum_number].hash
[enum_string, enum_integer, enum_number, outer_enum].hash
end
# Builds the object from hash

View File

@@ -0,0 +1,22 @@
=begin
#Swagger Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
=end
require 'date'
module Petstore
class OuterEnum
PLACED = "placed".freeze
APPROVED = "approved".freeze
DELIVERED = "delivered".freeze
end
end

View File

@@ -0,0 +1,41 @@
=begin
#Swagger Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Petstore::ClassModel
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
# Please update as you see appropriate
describe 'ClassModel' do
before do
# run before each test
@instance = Petstore::ClassModel.new
end
after do
# run after each test
end
describe 'test an instance of ClassModel' do
it 'should create an instact of ClassModel' do
expect(@instance).to be_instance_of(Petstore::ClassModel)
end
end
describe 'test attribute "_class"' do
it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end
end

View File

@@ -0,0 +1,35 @@
=begin
#Swagger Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Petstore::OuterEnum
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
# Please update as you see appropriate
describe 'OuterEnum' do
before do
# run before each test
@instance = Petstore::OuterEnum.new
end
after do
# run after each test
end
describe 'test an instance of OuterEnum' do
it 'should create an instact of OuterEnum' do
expect(@instance).to be_instance_of(Petstore::OuterEnum)
end
end
end