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}}}
- **Authorizatoin URL**: {{{authorizationUrl}}}
- **Scopes**: {{^scopes}}N/A{{/scopes}}
{{#scopes}} - **{{{scope}}}**: {{{description}}}
{{#scopes}} - **{{{scope}}}**: {{{description}}}
{{/scopes}}
{{/isOAuth}}

View File

@ -100,7 +100,7 @@ Class | Method | HTTP request | Description
- **Flow**: {{flow}}
- **Authorizatoin URL**: {{authorizationUrl}}
- **Scopes**: {{^scopes}}N/A{{/scopes}}
{{#scopes}}-- {{scope}}: {{description}}
{{#scopes}} - {{scope}}: {{description}}
{{/scopes}}
{{/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:
- 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
- Codegen version:
@ -329,8 +329,8 @@ Class | Method | HTTP request | Description
- **Flow**: implicit
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
- **write:pets**: modify pets in your account
- **read:pets**: read your pets

View File

@ -37,7 +37,7 @@ has version_info => ( is => 'ro',
default => sub { {
app_name => 'Swagger Petstore',
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',
} },
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
=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

View File

@ -6,7 +6,7 @@ Version: 1.0.0
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
## Installation
@ -159,6 +159,6 @@ Class | Method | HTTP request | Description
- **Flow**: implicit
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
-- write:pets: modify pets in your account
-- read:pets: read your pets
- write:pets: modify pets in your account
- read:pets: read your pets

View File

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

View File

@ -8,17 +8,17 @@ git_repo_id=$2
release_note=$3
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"
fi
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"
fi
if [ "$release_note" = "" ]; then
release_note=""
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi

View File

@ -360,7 +360,7 @@ module Petstore
# http body (model)
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,
:header_params => header_params,
:query_params => query_params,
@ -420,7 +420,7 @@ module Petstore
# http body (model)
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,
:header_params => header_params,
:query_params => query_params,
@ -480,7 +480,7 @@ module Petstore
# http body (model)
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,
:header_params => header_params,
:query_params => query_params,

View File

@ -301,7 +301,7 @@ module Petstore
# http body (model)
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,
:header_params => header_params,
:query_params => query_params,

View File

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

View File

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