forked from loafle/openapi-generator-original
update ruby petstore sample
This commit is contained in:
parent
b773d40034
commit
e73957e790
@ -4,10 +4,6 @@ class PetApi
|
|||||||
basePath = "http://petstore.swagger.io/v2"
|
basePath = "http://petstore.swagger.io/v2"
|
||||||
# apiInvoker = APIInvoker
|
# apiInvoker = APIInvoker
|
||||||
|
|
||||||
def self.escapeString(string)
|
|
||||||
URI.encode(string.to_s)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Update an existing pet
|
# Update an existing pet
|
||||||
#
|
#
|
||||||
@ -229,7 +225,7 @@ class PetApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', escapeString(pet_id))
|
path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
@ -275,7 +271,7 @@ class PetApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', escapeString(pet_id))
|
path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
@ -320,7 +316,7 @@ class PetApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', escapeString(pet_id))
|
path = "/pet/{petId}".sub('{format}','json').sub('{' + 'petId' + '}', pet_id)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
@ -365,7 +361,7 @@ class PetApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/pet/{petId}/uploadImage".sub('{format}','json').sub('{' + 'petId' + '}', escapeString(pet_id))
|
path = "/pet/{petId}/uploadImage".sub('{format}','json').sub('{' + 'petId' + '}', pet_id)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
|
@ -4,10 +4,6 @@ class StoreApi
|
|||||||
basePath = "http://petstore.swagger.io/v2"
|
basePath = "http://petstore.swagger.io/v2"
|
||||||
# apiInvoker = APIInvoker
|
# apiInvoker = APIInvoker
|
||||||
|
|
||||||
def self.escapeString(string)
|
|
||||||
URI.encode(string.to_s)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Returns pet inventories by status
|
# Returns pet inventories by status
|
||||||
# Returns a map of status codes to quantities
|
# Returns a map of status codes to quantities
|
||||||
@ -126,7 +122,7 @@ class StoreApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/store/order/{orderId}".sub('{format}','json').sub('{' + 'orderId' + '}', escapeString(order_id))
|
path = "/store/order/{orderId}".sub('{format}','json').sub('{' + 'orderId' + '}', order_id)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
@ -168,7 +164,7 @@ class StoreApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/store/order/{orderId}".sub('{format}','json').sub('{' + 'orderId' + '}', escapeString(order_id))
|
path = "/store/order/{orderId}".sub('{format}','json').sub('{' + 'orderId' + '}', order_id)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
|
@ -74,11 +74,6 @@ module Swagger
|
|||||||
def interpreted_path
|
def interpreted_path
|
||||||
p = self.path.dup
|
p = self.path.dup
|
||||||
|
|
||||||
# Fill in the path params
|
|
||||||
self.params.each_pair do |key, value|
|
|
||||||
p = p.gsub("{#{key}}", value.to_s)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Stick a .{format} placeholder into the path if there isn't
|
# Stick a .{format} placeholder into the path if there isn't
|
||||||
# one already or an actual format like json or xml
|
# one already or an actual format like json or xml
|
||||||
# e.g. /words/blah => /words.{format}/blah
|
# e.g. /words/blah => /words.{format}/blah
|
||||||
|
@ -4,10 +4,6 @@ class UserApi
|
|||||||
basePath = "http://petstore.swagger.io/v2"
|
basePath = "http://petstore.swagger.io/v2"
|
||||||
# apiInvoker = APIInvoker
|
# apiInvoker = APIInvoker
|
||||||
|
|
||||||
def self.escapeString(string)
|
|
||||||
URI.encode(string.to_s)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Create user
|
# Create user
|
||||||
# This can only be done by the logged in user.
|
# This can only be done by the logged in user.
|
||||||
@ -286,7 +282,7 @@ class UserApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', escapeString(username))
|
path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
@ -330,7 +326,7 @@ class UserApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', escapeString(username))
|
path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
@ -391,7 +387,7 @@ class UserApi
|
|||||||
}.merge(opts)
|
}.merge(opts)
|
||||||
|
|
||||||
#resource path
|
#resource path
|
||||||
path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', escapeString(username))
|
path = "/user/{username}".sub('{format}','json').sub('{' + 'username' + '}', username)
|
||||||
|
|
||||||
|
|
||||||
# pull querystring keys from options
|
# pull querystring keys from options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user