diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION b/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION index a6254504e40..855ff9501eb 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/README.md b/samples/client/petstore/dart/flutter_petstore/swagger/README.md index 7244e3f3b94..2136cafdd5d 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/README.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/README.md @@ -59,7 +59,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md index 8832e57f4ab..6f353923e87 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md index b2615f0d4f5..de492737ace 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md index 2c14f3508d4..9b71d075453 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -199,7 +199,7 @@ Get user by user name import 'package:swagger/api.dart'; var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { var result = api_instance.getUserByName(username); @@ -213,7 +213,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart index a13a8218c65..4888f158f55 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart @@ -18,7 +18,7 @@ class ApiClient { final _RegList = new RegExp(r'^List<(.*)>$'); final _RegMap = new RegExp(r'^Map$'); - ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath: "http://localhost/v2"}) { // Setup authentications (key: authentication name, value: authentication). _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); _authentications['petstore_auth'] = new OAuth(); @@ -149,4 +149,12 @@ class ApiClient { auth.applyToParams(queryParams, headerParams); }); } + + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); + } } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart index 3d6b6aadcda..b1a7c574cf9 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart @@ -1,7 +1,7 @@ part of swagger.api; abstract class Authentication { - + /// Apply authentication settings to header and query params. void applyToParams(List queryParams, Map headerParams); -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart index d0872d09a0f..10726213b45 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart @@ -1,9 +1,19 @@ part of swagger.api; class OAuth implements Authentication { + String accessToken; + + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - // TODO: support oauth + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; + } + } + + void setAccessToken(String accessToken) { + this.accessToken = accessToken; } } diff --git a/samples/client/petstore/dart/swagger-browser-client/.swagger-codegen/VERSION b/samples/client/petstore/dart/swagger-browser-client/.swagger-codegen/VERSION index a6254504e40..855ff9501eb 100644 --- a/samples/client/petstore/dart/swagger-browser-client/.swagger-codegen/VERSION +++ b/samples/client/petstore/dart/swagger-browser-client/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/swagger-browser-client/README.md b/samples/client/petstore/dart/swagger-browser-client/README.md index 7244e3f3b94..2136cafdd5d 100644 --- a/samples/client/petstore/dart/swagger-browser-client/README.md +++ b/samples/client/petstore/dart/swagger-browser-client/README.md @@ -59,7 +59,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/PetApi.md b/samples/client/petstore/dart/swagger-browser-client/docs/PetApi.md index 8832e57f4ab..6f353923e87 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/PetApi.md +++ b/samples/client/petstore/dart/swagger-browser-client/docs/PetApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/StoreApi.md b/samples/client/petstore/dart/swagger-browser-client/docs/StoreApi.md index b2615f0d4f5..de492737ace 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/StoreApi.md +++ b/samples/client/petstore/dart/swagger-browser-client/docs/StoreApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/UserApi.md b/samples/client/petstore/dart/swagger-browser-client/docs/UserApi.md index 2c14f3508d4..9b71d075453 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/UserApi.md +++ b/samples/client/petstore/dart/swagger-browser-client/docs/UserApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -199,7 +199,7 @@ Get user by user name import 'package:swagger/api.dart'; var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { var result = api_instance.getUserByName(username); @@ -213,7 +213,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/api_client.dart b/samples/client/petstore/dart/swagger-browser-client/lib/api_client.dart index beee9e40f9e..679c5f3c75c 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/api_client.dart +++ b/samples/client/petstore/dart/swagger-browser-client/lib/api_client.dart @@ -18,7 +18,7 @@ class ApiClient { final _RegList = new RegExp(r'^List<(.*)>$'); final _RegMap = new RegExp(r'^Map$'); - ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath: "http://localhost/v2"}) { // Setup authentications (key: authentication name, value: authentication). _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); _authentications['petstore_auth'] = new OAuth(); @@ -149,4 +149,12 @@ class ApiClient { auth.applyToParams(queryParams, headerParams); }); } + + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); + } } diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/auth/authentication.dart b/samples/client/petstore/dart/swagger-browser-client/lib/auth/authentication.dart index 3d6b6aadcda..b1a7c574cf9 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/auth/authentication.dart +++ b/samples/client/petstore/dart/swagger-browser-client/lib/auth/authentication.dart @@ -1,7 +1,7 @@ part of swagger.api; abstract class Authentication { - + /// Apply authentication settings to header and query params. void applyToParams(List queryParams, Map headerParams); -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/auth/oauth.dart b/samples/client/petstore/dart/swagger-browser-client/lib/auth/oauth.dart index d0872d09a0f..10726213b45 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/swagger-browser-client/lib/auth/oauth.dart @@ -1,9 +1,19 @@ part of swagger.api; class OAuth implements Authentication { + String accessToken; + + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - // TODO: support oauth + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; + } + } + + void setAccessToken(String accessToken) { + this.accessToken = accessToken; } } diff --git a/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION b/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION index a6254504e40..855ff9501eb 100644 --- a/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION +++ b/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/swagger/README.md b/samples/client/petstore/dart/swagger/README.md index 7244e3f3b94..2136cafdd5d 100644 --- a/samples/client/petstore/dart/swagger/README.md +++ b/samples/client/petstore/dart/swagger/README.md @@ -59,7 +59,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger/docs/PetApi.md b/samples/client/petstore/dart/swagger/docs/PetApi.md index 8832e57f4ab..6f353923e87 100644 --- a/samples/client/petstore/dart/swagger/docs/PetApi.md +++ b/samples/client/petstore/dart/swagger/docs/PetApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger/docs/StoreApi.md b/samples/client/petstore/dart/swagger/docs/StoreApi.md index b2615f0d4f5..de492737ace 100644 --- a/samples/client/petstore/dart/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart/swagger/docs/StoreApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger/docs/UserApi.md b/samples/client/petstore/dart/swagger/docs/UserApi.md index 2c14f3508d4..9b71d075453 100644 --- a/samples/client/petstore/dart/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart/swagger/docs/UserApi.md @@ -5,7 +5,7 @@ import 'package:swagger/api.dart'; ``` -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://localhost/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -199,7 +199,7 @@ Get user by user name import 'package:swagger/api.dart'; var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. +var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { var result = api_instance.getUserByName(username); @@ -213,7 +213,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/dart/swagger/lib/api_client.dart b/samples/client/petstore/dart/swagger/lib/api_client.dart index a13a8218c65..4888f158f55 100644 --- a/samples/client/petstore/dart/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/swagger/lib/api_client.dart @@ -18,7 +18,7 @@ class ApiClient { final _RegList = new RegExp(r'^List<(.*)>$'); final _RegMap = new RegExp(r'^Map$'); - ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath: "http://localhost/v2"}) { // Setup authentications (key: authentication name, value: authentication). _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); _authentications['petstore_auth'] = new OAuth(); @@ -149,4 +149,12 @@ class ApiClient { auth.applyToParams(queryParams, headerParams); }); } + + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); + } } diff --git a/samples/client/petstore/dart/swagger/lib/auth/authentication.dart b/samples/client/petstore/dart/swagger/lib/auth/authentication.dart index 3d6b6aadcda..b1a7c574cf9 100644 --- a/samples/client/petstore/dart/swagger/lib/auth/authentication.dart +++ b/samples/client/petstore/dart/swagger/lib/auth/authentication.dart @@ -1,7 +1,7 @@ part of swagger.api; abstract class Authentication { - + /// Apply authentication settings to header and query params. void applyToParams(List queryParams, Map headerParams); -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart/swagger/lib/auth/oauth.dart b/samples/client/petstore/dart/swagger/lib/auth/oauth.dart index d0872d09a0f..10726213b45 100644 --- a/samples/client/petstore/dart/swagger/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/swagger/lib/auth/oauth.dart @@ -1,9 +1,19 @@ part of swagger.api; class OAuth implements Authentication { + String accessToken; + + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - // TODO: support oauth + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; + } + } + + void setAccessToken(String accessToken) { + this.accessToken = accessToken; } } diff --git a/samples/client/petstore/ruby/.rubocop.yml b/samples/client/petstore/ruby/.rubocop.yml index 03eb72099cf..19a777e1615 100644 --- a/samples/client/petstore/ruby/.rubocop.yml +++ b/samples/client/petstore/ruby/.rubocop.yml @@ -1,10 +1,11 @@ +# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) +# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) AllCops: TargetRubyVersion: 2.2 # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop # to ignore them, so only the ones explicitly set in this file are enabled. DisabledByDefault: true Exclude: - - '**/spec/**/*' - '**/templates/**/*' - '**/vendor/**/*' - 'actionpack/lib/action_dispatch/journey/parser.rb' @@ -113,9 +114,9 @@ Layout/SpaceInsideParens: Enabled: true # Check quotes usage according to lint rule below. -Style/StringLiterals: - Enabled: true - EnforcedStyle: single_quotes +#Style/StringLiterals: +# Enabled: true +# EnforcedStyle: single_quotes # Detect hard tabs, no hard tabs. Layout/Tab: diff --git a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md index cecdf785dfd..1237031fb07 100644 --- a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md @@ -12,6 +12,8 @@ Method | HTTP request | Description To test class name in snake case +To test class name in snake case + ### Example ```ruby # load the gem diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 77cb53edcd4..0dce0baa119 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -20,6 +20,7 @@ module Petstore @api_client = api_client end # To test class name in snake case + # To test class name in snake case # @param body client model # @param [Hash] opts the optional parameters # @return [Client] @@ -28,6 +29,7 @@ module Petstore data end + # To test class name in snake case # To test class name in snake case # @param body client model # @param [Hash] opts the optional parameters diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index e98124c81db..c4fb186e4c5 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -248,7 +248,7 @@ module Petstore @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - 'explicitly with `tempfile.delete`' + "explicitly with `tempfile.delete`" end end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index f33dbfc64a2..caefa3815a8 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -# + =begin #Swagger Petstore @@ -24,8 +24,7 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/swagger-api/swagger-codegen" s.summary = "Swagger Petstore Ruby Gem" s.description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" - # TODO uncomment and update below with a proper license - #s.license = "Apache 2.0" + s.license = "Unlicense" s.required_ruby_version = ">= 1.9" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' @@ -39,7 +38,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' - s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? } + s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") s.executables = [] s.require_paths = ["lib"]