fix perl, ruby auth doc in readme

This commit is contained in:
wing328 2016-03-16 14:58:19 +08:00
parent 259d113d35
commit 7b31dabe77
11 changed files with 88 additions and 77 deletions

View File

@ -260,7 +260,7 @@ Class | Method | HTTP request | Description
- **Flow**: {{{flow}}} - **Flow**: {{{flow}}}
- **Authorizatoin URL**: {{{authorizationUrl}}} - **Authorizatoin URL**: {{{authorizationUrl}}}
- **Scopes**: {{^scopes}}N/A{{/scopes}} - **Scopes**: {{^scopes}}N/A{{/scopes}}
{{#scopes}} - **{{{scope}}}**: {{{description}}} {{#scopes}} - **{{{scope}}}**: {{{description}}}
{{/scopes}} {{/scopes}}
{{/isOAuth}} {{/isOAuth}}

View File

@ -100,7 +100,7 @@ Class | Method | HTTP request | Description
- **Flow**: {{flow}} - **Flow**: {{flow}}
- **Authorizatoin URL**: {{authorizationUrl}} - **Authorizatoin URL**: {{authorizationUrl}}
- **Scopes**: {{^scopes}}N/A{{/scopes}} - **Scopes**: {{^scopes}}N/A{{/scopes}}
{{#scopes}}-- {{scope}}: {{description}} {{#scopes}} - {{scope}}: {{description}}
{{/scopes}} {{/scopes}}
{{/isOAuth}} {{/isOAuth}}

View File

@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore
Automatically generated by the Perl Swagger Codegen project: Automatically generated by the Perl Swagger Codegen project:
- Build date: 2016-03-13T22:43:11.863+08:00 - Build date: 2016-03-16T14:57:20.078+08:00
- Build package: class io.swagger.codegen.languages.PerlClientCodegen - Build package: class io.swagger.codegen.languages.PerlClientCodegen
- Codegen version: - Codegen version:
@ -329,8 +329,8 @@ Class | Method | HTTP request | Description
- **Flow**: implicit - **Flow**: implicit
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog - **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**: - **Scopes**:
- **write:pets**: modify pets in your account - **write:pets**: modify pets in your account
- **read:pets**: read your pets - **read:pets**: read your pets

View File

@ -37,7 +37,7 @@ has version_info => ( is => 'ro',
default => sub { { default => sub { {
app_name => 'Swagger Petstore', app_name => 'Swagger Petstore',
app_version => '1.0.0', app_version => '1.0.0',
generated_date => '2016-03-13T22:43:11.863+08:00', generated_date => '2016-03-16T14:57:20.078+08:00',
generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen',
} }, } },
documentation => 'Information about the application version and the codegen codebase version' documentation => 'Information about the application version and the codegen codebase version'
@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project:
=over 4 =over 4
=item Build date: 2016-03-13T22:43:11.863+08:00 =item Build date: 2016-03-16T14:57:20.078+08:00
=item Build package: class io.swagger.codegen.languages.PerlClientCodegen =item Build package: class io.swagger.codegen.languages.PerlClientCodegen

View File

@ -6,7 +6,7 @@ Version: 1.0.0
Automatically generated by the Ruby Swagger Codegen project: Automatically generated by the Ruby Swagger Codegen project:
- Build date: 2016-03-14T21:56:19.858+08:00 - Build date: 2016-03-16T14:58:08.710+08:00
- Build package: class io.swagger.codegen.languages.RubyClientCodegen - Build package: class io.swagger.codegen.languages.RubyClientCodegen
## Installation ## Installation
@ -159,6 +159,6 @@ Class | Method | HTTP request | Description
- **Flow**: implicit - **Flow**: implicit
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog - **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**: - **Scopes**:
-- write:pets: modify pets in your account - write:pets: modify pets in your account
-- read:pets: read your pets - read:pets: read your pets

View File

@ -23,6 +23,8 @@ This can only be done by the logged in user.
### Example ### Example
```ruby ```ruby
require 'petstore'
api = Petstore::UserApi.new api = Petstore::UserApi.new
opts = { opts = {
@ -66,6 +68,8 @@ Creates list of users with given input array
### Example ### Example
```ruby ```ruby
require 'petstore'
api = Petstore::UserApi.new api = Petstore::UserApi.new
opts = { opts = {
@ -109,6 +113,8 @@ Creates list of users with given input array
### Example ### Example
```ruby ```ruby
require 'petstore'
api = Petstore::UserApi.new api = Petstore::UserApi.new
opts = { opts = {
@ -152,6 +158,8 @@ This can only be done by the logged in user.
### Example ### Example
```ruby ```ruby
require 'petstore'
Petstore.configure do |config| Petstore.configure do |config|
# Configure HTTP basic authorization: test_http_basic # Configure HTTP basic authorization: test_http_basic
config.username = 'YOUR USERNAME' config.username = 'YOUR USERNAME'
@ -200,6 +208,8 @@ Get user by user name
### Example ### Example
```ruby ```ruby
require 'petstore'
api = Petstore::UserApi.new api = Petstore::UserApi.new
username = "username_example" # [String] The name that needs to be fetched. Use user1 for testing. username = "username_example" # [String] The name that needs to be fetched. Use user1 for testing.
@ -207,6 +217,7 @@ username = "username_example" # [String] The name that needs to be fetched. Use
begin begin
result = api.get_user_by_name(username) result = api.get_user_by_name(username)
p result
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling get_user_by_name: #{e}" puts "Exception when calling get_user_by_name: #{e}"
end end
@ -242,6 +253,8 @@ Logs user into the system
### Example ### Example
```ruby ```ruby
require 'petstore'
api = Petstore::UserApi.new api = Petstore::UserApi.new
opts = { opts = {
@ -251,6 +264,7 @@ opts = {
begin begin
result = api.login_user(opts) result = api.login_user(opts)
p result
rescue Petstore::ApiError => e rescue Petstore::ApiError => e
puts "Exception when calling login_user: #{e}" puts "Exception when calling login_user: #{e}"
end end
@ -287,6 +301,8 @@ Logs out current logged in user session
### Example ### Example
```ruby ```ruby
require 'petstore'
api = Petstore::UserApi.new api = Petstore::UserApi.new
begin begin
@ -323,6 +339,8 @@ This can only be done by the logged in user.
### Example ### Example
```ruby ```ruby
require 'petstore'
api = Petstore::UserApi.new api = Petstore::UserApi.new
username = "username_example" # [String] name that need to be deleted username = "username_example" # [String] name that need to be deleted

View File

@ -8,17 +8,17 @@ git_repo_id=$2
release_note=$3 release_note=$3
if [ "$git_user_id" = "" ]; then if [ "$git_user_id" = "" ]; then
git_user_id="" git_user_id="YOUR_GIT_USR_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi fi
if [ "$git_repo_id" = "" ]; then if [ "$git_repo_id" = "" ]; then
git_repo_id="" git_repo_id="YOUR_GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi fi
if [ "$release_note" = "" ]; then if [ "$release_note" = "" ]; then
release_note="" release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note" echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi fi

View File

@ -360,7 +360,7 @@ module Petstore
# http body (model) # http body (model)
post_body = nil post_body = nil
auth_names = ['petstore_auth', 'api_key'] auth_names = ['api_key', 'petstore_auth']
data, status_code, headers = @api_client.call_api(:GET, local_var_path, data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params, :header_params => header_params,
:query_params => query_params, :query_params => query_params,
@ -420,7 +420,7 @@ module Petstore
# http body (model) # http body (model)
post_body = nil post_body = nil
auth_names = ['petstore_auth', 'api_key'] auth_names = ['api_key', 'petstore_auth']
data, status_code, headers = @api_client.call_api(:GET, local_var_path, data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params, :header_params => header_params,
:query_params => query_params, :query_params => query_params,
@ -480,7 +480,7 @@ module Petstore
# http body (model) # http body (model)
post_body = nil post_body = nil
auth_names = ['petstore_auth', 'api_key'] auth_names = ['api_key', 'petstore_auth']
data, status_code, headers = @api_client.call_api(:GET, local_var_path, data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params, :header_params => header_params,
:query_params => query_params, :query_params => query_params,

View File

@ -301,7 +301,7 @@ module Petstore
# http body (model) # http body (model)
post_body = nil post_body = nil
auth_names = ['test_api_key_query', 'test_api_key_header'] auth_names = ['test_api_key_header', 'test_api_key_query']
data, status_code, headers = @api_client.call_api(:GET, local_var_path, data, status_code, headers = @api_client.call_api(:GET, local_var_path,
:header_params => header_params, :header_params => header_params,
:query_params => query_params, :query_params => query_params,

View File

@ -157,33 +157,12 @@ module Petstore
# Returns Auth Settings hash for api client. # Returns Auth Settings hash for api client.
def auth_settings def auth_settings
{ {
'petstore_auth' => 'test_api_key_header' =>
{
type: 'oauth2',
in: 'header',
key: 'Authorization',
value: "Bearer #{access_token}"
},
'test_api_client_id' =>
{ {
type: 'api_key', type: 'api_key',
in: 'header', in: 'header',
key: 'x-test_api_client_id', key: 'test_api_key_header',
value: api_key_with_prefix('x-test_api_client_id') value: api_key_with_prefix('test_api_key_header')
},
'test_http_basic' =>
{
type: 'basic',
in: 'header',
key: 'Authorization',
value: basic_auth_token
},
'test_api_client_secret' =>
{
type: 'api_key',
in: 'header',
key: 'x-test_api_client_secret',
value: api_key_with_prefix('x-test_api_client_secret')
}, },
'api_key' => 'api_key' =>
{ {
@ -199,6 +178,20 @@ module Petstore
key: 'Authorization', key: 'Authorization',
value: basic_auth_token value: basic_auth_token
}, },
'test_api_client_secret' =>
{
type: 'api_key',
in: 'header',
key: 'x-test_api_client_secret',
value: api_key_with_prefix('x-test_api_client_secret')
},
'test_api_client_id' =>
{
type: 'api_key',
in: 'header',
key: 'x-test_api_client_id',
value: api_key_with_prefix('x-test_api_client_id')
},
'test_api_key_query' => 'test_api_key_query' =>
{ {
type: 'api_key', type: 'api_key',
@ -206,12 +199,12 @@ module Petstore
key: 'test_api_key_query', key: 'test_api_key_query',
value: api_key_with_prefix('test_api_key_query') value: api_key_with_prefix('test_api_key_query')
}, },
'test_api_key_header' => 'petstore_auth' =>
{ {
type: 'api_key', type: 'oauth2',
in: 'header', in: 'header',
key: 'test_api_key_header', key: 'Authorization',
value: api_key_with_prefix('test_api_key_header') value: "Bearer #{access_token}"
}, },
} }
end end

View File

@ -18,34 +18,34 @@ require 'date'
module Petstore module Petstore
class InlineResponse200 class InlineResponse200
attr_accessor :photo_urls attr_accessor :tags
attr_accessor :name
attr_accessor :id attr_accessor :id
attr_accessor :category attr_accessor :category
attr_accessor :tags
# pet status in the store # pet status in the store
attr_accessor :status attr_accessor :status
attr_accessor :name
attr_accessor :photo_urls
# 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
{ {
:'photo_urls' => :'photoUrls', :'tags' => :'tags',
:'name' => :'name',
:'id' => :'id', :'id' => :'id',
:'category' => :'category', :'category' => :'category',
:'tags' => :'tags', :'status' => :'status',
:'status' => :'status' :'name' => :'name',
:'photo_urls' => :'photoUrls'
} }
end end
@ -53,12 +53,12 @@ module Petstore
# Attribute type mapping. # Attribute type mapping.
def self.swagger_types def self.swagger_types
{ {
:'photo_urls' => :'Array<String>', :'tags' => :'Array<Tag>',
:'name' => :'String',
:'id' => :'Integer', :'id' => :'Integer',
:'category' => :'Object', :'category' => :'Object',
:'tags' => :'Array<Tag>', :'status' => :'String',
:'status' => :'String' :'name' => :'String',
:'photo_urls' => :'Array<String>'
} }
end end
@ -70,16 +70,12 @@ module Petstore
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
if attributes[:'photoUrls'] if attributes[:'tags']
if (value = attributes[:'photoUrls']).is_a?(Array) if (value = attributes[:'tags']).is_a?(Array)
self.photo_urls = value self.tags = value
end end
end end
if attributes[:'name']
self.name = attributes[:'name']
end
if attributes[:'id'] if attributes[:'id']
self.id = attributes[:'id'] self.id = attributes[:'id']
end end
@ -88,16 +84,20 @@ module Petstore
self.category = attributes[:'category'] self.category = attributes[:'category']
end end
if attributes[:'tags']
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end
if attributes[:'status'] if attributes[:'status']
self.status = attributes[:'status'] self.status = attributes[:'status']
end end
if attributes[:'name']
self.name = attributes[:'name']
end
if attributes[:'photoUrls']
if (value = attributes[:'photoUrls']).is_a?(Array)
self.photo_urls = value
end
end
end end
# Custom attribute writer method checking allowed values (enum). # Custom attribute writer method checking allowed values (enum).
@ -113,12 +113,12 @@ module Petstore
def ==(o) def ==(o)
return true if self.equal?(o) return true if self.equal?(o)
self.class == o.class && self.class == o.class &&
photo_urls == o.photo_urls && tags == o.tags &&
name == o.name &&
id == o.id && id == o.id &&
category == o.category && category == o.category &&
tags == o.tags && status == o.status &&
status == o.status name == o.name &&
photo_urls == o.photo_urls
end end
# @see the `==` method # @see the `==` method
@ -128,7 +128,7 @@ module Petstore
# Calculate hash code according to all attributes. # Calculate hash code according to all attributes.
def hash def hash
[photo_urls, name, id, category, tags, status].hash [tags, id, category, status, name, photo_urls].hash
end end
# build the object from hash # build the object from hash