mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
fix summary tab in ruby api
This commit is contained in:
parent
04e56a165e
commit
d78113be95
@ -14,7 +14,7 @@ module {{moduleName}}
|
||||
end
|
||||
{{#operation}}
|
||||
{{newline}}
|
||||
# {{summary}}}
|
||||
# {{{summary}}}
|
||||
# {{{notes}}}
|
||||
{{#allParams}}{{#required}} # @param {{paramName}} {{description}}
|
||||
{{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
|
||||
|
@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
||||
|
||||
- API verion: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-03-18T17:42:42.943+08:00
|
||||
- Build date: 2016-03-19T11:13:14.822+08:00
|
||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
@ -35,9 +35,7 @@ Finally add this to the Gemfile:
|
||||
|
||||
### Install from Git
|
||||
|
||||
If the Ruby gem is hosted a git repository: https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID
|
||||
|
||||
Then add the following in the Gemfile:
|
||||
If the Ruby gem is hosted at a git repository: https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID, then add the following in the Gemfile:
|
||||
|
||||
gem 'petstore', :git => 'https://github.com/YOUR_GIT_USR_ID/YOUR_GIT_REPO_ID.git'
|
||||
|
||||
|
@ -4,5 +4,6 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Integer** | | [optional]
|
||||
**snake_case** | **Integer** | | [optional]
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ module Petstore
|
||||
@api_client = api_client
|
||||
end
|
||||
|
||||
# Add a new pet to the store}
|
||||
# Add a new pet to the store
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||
@ -80,7 +80,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Fake endpoint to test byte array in body parameter for adding a new pet to the store}
|
||||
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :body Pet object in the form of byte array
|
||||
@ -136,7 +136,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Deletes a pet}
|
||||
# Deletes a pet
|
||||
#
|
||||
# @param pet_id Pet id to delete
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -198,7 +198,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Finds Pets by status}
|
||||
# Finds Pets by status
|
||||
# Multiple status values can be provided with comma separated strings
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :status Status values that need to be considered for query (default to available)
|
||||
@ -256,7 +256,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Finds Pets by tags}
|
||||
# Finds Pets by tags
|
||||
# Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<String>] :tags Tags to filter by
|
||||
@ -314,7 +314,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Find pet by ID}
|
||||
# Find pet by ID
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -374,7 +374,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'}
|
||||
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -434,7 +434,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Fake endpoint to test byte array return by 'Find pet by ID'}
|
||||
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
# Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
# @param pet_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -494,7 +494,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Update an existing pet}
|
||||
# Update an existing pet
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Pet] :body Pet object that needs to be added to the store
|
||||
@ -550,7 +550,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Updates a pet in the store with form data}
|
||||
# Updates a pet in the store with form data
|
||||
#
|
||||
# @param pet_id ID of pet that needs to be updated
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -615,7 +615,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# uploads an image}
|
||||
# uploads an image
|
||||
#
|
||||
# @param pet_id ID of pet to update
|
||||
# @param [Hash] opts the optional parameters
|
||||
|
@ -24,7 +24,7 @@ module Petstore
|
||||
@api_client = api_client
|
||||
end
|
||||
|
||||
# Delete purchase order by ID}
|
||||
# Delete purchase order by ID
|
||||
# For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
# @param order_id ID of the order that needs to be deleted
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -83,7 +83,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Finds orders by status}
|
||||
# Finds orders by status
|
||||
# A single status value can be provided as a string
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :status Status value that needs to be considered for query (default to placed)
|
||||
@ -145,7 +145,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Returns pet inventories by status}
|
||||
# Returns pet inventories by status
|
||||
# Returns a map of status codes to quantities
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Hash<String, Integer>]
|
||||
@ -200,7 +200,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Fake endpoint to test arbitrary object return by 'Get inventory'}
|
||||
# Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
# Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [Object]
|
||||
@ -255,7 +255,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Find purchase order by ID}
|
||||
# Find purchase order by ID
|
||||
# For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
# @param order_id ID of pet that needs to be fetched
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -315,7 +315,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Place an order for a pet}
|
||||
# Place an order for a pet
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Order] :body order placed for purchasing the pet
|
||||
|
@ -24,7 +24,7 @@ module Petstore
|
||||
@api_client = api_client
|
||||
end
|
||||
|
||||
# Create user}
|
||||
# Create user
|
||||
# This can only be done by the logged in user.
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [User] :body Created user object
|
||||
@ -80,7 +80,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Creates list of users with given input array}
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<User>] :body List of user object
|
||||
@ -136,7 +136,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Creates list of users with given input array}
|
||||
# Creates list of users with given input array
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [Array<User>] :body List of user object
|
||||
@ -192,7 +192,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Delete user}
|
||||
# Delete user
|
||||
# This can only be done by the logged in user.
|
||||
# @param username The name that needs to be deleted
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -251,7 +251,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Get user by user name}
|
||||
# Get user by user name
|
||||
#
|
||||
# @param username The name that needs to be fetched. Use user1 for testing.
|
||||
# @param [Hash] opts the optional parameters
|
||||
@ -311,7 +311,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Logs user into the system}
|
||||
# Logs user into the system
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @option opts [String] :username The user name for login
|
||||
@ -372,7 +372,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Logs out current logged in user session}
|
||||
# Logs out current logged in user session
|
||||
#
|
||||
# @param [Hash] opts the optional parameters
|
||||
# @return [nil]
|
||||
@ -426,7 +426,7 @@ module Petstore
|
||||
return data, status_code, headers
|
||||
end
|
||||
|
||||
# Updated user}
|
||||
# Updated user
|
||||
# This can only be done by the logged in user.
|
||||
# @param username name that need to be deleted
|
||||
# @param [Hash] opts the optional parameters
|
||||
|
@ -20,11 +20,15 @@ module Petstore
|
||||
class Name
|
||||
attr_accessor :name
|
||||
|
||||
attr_accessor :snake_case
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
|
||||
:'name' => :'name'
|
||||
:'name' => :'name',
|
||||
|
||||
:'snake_case' => :'snake_case'
|
||||
|
||||
}
|
||||
end
|
||||
@ -32,7 +36,8 @@ module Petstore
|
||||
# Attribute type mapping.
|
||||
def self.swagger_types
|
||||
{
|
||||
:'name' => :'Integer'
|
||||
:'name' => :'Integer',
|
||||
:'snake_case' => :'Integer'
|
||||
|
||||
}
|
||||
end
|
||||
@ -48,13 +53,18 @@ module Petstore
|
||||
self.name = attributes[:'name']
|
||||
end
|
||||
|
||||
if attributes[:'snake_case']
|
||||
self.snake_case = attributes[:'snake_case']
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Check equality by comparing each attribute.
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
name == o.name
|
||||
name == o.name &&
|
||||
snake_case == o.snake_case
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
@ -64,7 +74,7 @@ module Petstore
|
||||
|
||||
# Calculate hash code according to all attributes.
|
||||
def hash
|
||||
[name].hash
|
||||
[name, snake_case].hash
|
||||
end
|
||||
|
||||
# build the object from hash
|
||||
|
@ -46,5 +46,15 @@ describe 'Name' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "snake_case"' do
|
||||
it 'should work' do
|
||||
# assertion here
|
||||
# should be_a()
|
||||
# should be_nil
|
||||
# should ==
|
||||
# should_not ==
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user