forked from loafle/openapi-generator-original
Ruby: place properties on separate lines with description
This commit is contained in:
parent
79033e57fe
commit
ddc4b0a548
@ -1,13 +1,14 @@
|
|||||||
module {{moduleName}}{{#models}}{{#model}}{{#description}}
|
module {{moduleName}}{{#models}}{{#model}}{{#description}}
|
||||||
# {{{description}}}{{/description}}
|
# {{{description}}}{{/description}}
|
||||||
class {{classname}} < BaseObject
|
class {{classname}} < BaseObject{{#vars}}{{#description}}
|
||||||
attr_accessor {{#vars}}:{{{name}}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{newline}}
|
# {{{description}}}{{/description}}
|
||||||
|
attr_accessor :{{{name}}}
|
||||||
|
{{/vars}}
|
||||||
|
|
||||||
# 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
|
||||||
{
|
{
|
||||||
{{#vars}}{{#description}}
|
{{#vars}}
|
||||||
# {{{description}}}{{/description}}
|
|
||||||
:'{{{name}}}' => :'{{{baseName}}}'{{#hasMore}},{{/hasMore}}
|
:'{{{name}}}' => :'{{{baseName}}}'{{#hasMore}},{{/hasMore}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
module Petstore
|
module Petstore
|
||||||
class Category < BaseObject
|
class Category < BaseObject
|
||||||
attr_accessor :id, :name
|
attr_accessor :id
|
||||||
|
|
||||||
|
attr_accessor :name
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
module Petstore
|
module Petstore
|
||||||
class Order < BaseObject
|
class Order < BaseObject
|
||||||
attr_accessor :id, :pet_id, :quantity, :ship_date, :status, :complete
|
attr_accessor :id
|
||||||
|
|
||||||
|
attr_accessor :pet_id
|
||||||
|
|
||||||
|
attr_accessor :quantity
|
||||||
|
|
||||||
|
attr_accessor :ship_date
|
||||||
|
|
||||||
|
# Order Status
|
||||||
|
attr_accessor :status
|
||||||
|
|
||||||
|
attr_accessor :complete
|
||||||
|
|
||||||
# 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
|
||||||
@ -14,7 +25,6 @@ module Petstore
|
|||||||
|
|
||||||
:'ship_date' => :'shipDate',
|
:'ship_date' => :'shipDate',
|
||||||
|
|
||||||
# Order Status
|
|
||||||
:'status' => :'status',
|
:'status' => :'status',
|
||||||
|
|
||||||
:'complete' => :'complete'
|
:'complete' => :'complete'
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
module Petstore
|
module Petstore
|
||||||
class Pet < BaseObject
|
class Pet < BaseObject
|
||||||
attr_accessor :id, :category, :name, :photo_urls, :tags, :status
|
attr_accessor :id
|
||||||
|
|
||||||
|
attr_accessor :category
|
||||||
|
|
||||||
|
attr_accessor :name
|
||||||
|
|
||||||
|
attr_accessor :photo_urls
|
||||||
|
|
||||||
|
attr_accessor :tags
|
||||||
|
|
||||||
|
# pet status in the store
|
||||||
|
attr_accessor :status
|
||||||
|
|
||||||
# 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
|
||||||
@ -16,7 +27,6 @@ module Petstore
|
|||||||
|
|
||||||
:'tags' => :'tags',
|
:'tags' => :'tags',
|
||||||
|
|
||||||
# pet status in the store
|
|
||||||
:'status' => :'status'
|
:'status' => :'status'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
module Petstore
|
module Petstore
|
||||||
class Tag < BaseObject
|
class Tag < BaseObject
|
||||||
attr_accessor :id, :name
|
attr_accessor :id
|
||||||
|
|
||||||
|
attr_accessor :name
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -1,6 +1,21 @@
|
|||||||
module Petstore
|
module Petstore
|
||||||
class User < BaseObject
|
class User < BaseObject
|
||||||
attr_accessor :id, :username, :first_name, :last_name, :email, :password, :phone, :user_status
|
attr_accessor :id
|
||||||
|
|
||||||
|
attr_accessor :username
|
||||||
|
|
||||||
|
attr_accessor :first_name
|
||||||
|
|
||||||
|
attr_accessor :last_name
|
||||||
|
|
||||||
|
attr_accessor :email
|
||||||
|
|
||||||
|
attr_accessor :password
|
||||||
|
|
||||||
|
attr_accessor :phone
|
||||||
|
|
||||||
|
# User Status
|
||||||
|
attr_accessor :user_status
|
||||||
|
|
||||||
# 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
|
||||||
@ -20,7 +35,6 @@ module Petstore
|
|||||||
|
|
||||||
:'phone' => :'phone',
|
:'phone' => :'phone',
|
||||||
|
|
||||||
# User Status
|
|
||||||
:'user_status' => :'userStatus'
|
:'user_status' => :'userStatus'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user