diff --git a/modules/swagger-codegen/src/main/resources/perl/README.mustache b/modules/swagger-codegen/src/main/resources/perl/README.mustache index c2a0f8f3f2b..771dd76b8b1 100644 --- a/modules/swagger-codegen/src/main/resources/perl/README.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/README.mustache @@ -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}} diff --git a/modules/swagger-codegen/src/main/resources/ruby/README.mustache b/modules/swagger-codegen/src/main/resources/ruby/README.mustache index c9a21277c77..d55fe28ad25 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/README.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/README.mustache @@ -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}} diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 3758d282ddd..3f87edd1ec5 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -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 diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index ab84d287c40..99a175ea451 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -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 diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 7cbfdadfc67..bb77c31c8ea 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -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 diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index 284c5e3a314..c629e696410 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -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 diff --git a/samples/client/petstore/ruby/git_push.sh b/samples/client/petstore/ruby/git_push.sh index 6ca091b49d9..1a36388db02 100644 --- a/samples/client/petstore/ruby/git_push.sh +++ b/samples/client/petstore/ruby/git_push.sh @@ -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 diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 4a5d45d766c..29f631a983e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -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, diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 7bdfd013bf6..11bdfaadf62 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -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, diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 94a1b566a1e..5125ebe5960 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_response_200.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_response_200.rb index a793250e45b..190170f18eb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_response_200.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_response_200.rb @@ -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', - :'name' => :'String', + :'tags' => :'Array', :'id' => :'Integer', :'category' => :'Object', - :'tags' => :'Array', - :'status' => :'String' + :'status' => :'String', + :'name' => :'String', + :'photo_urls' => :'Array' } 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