diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index 6da8958fe13..eda6c2a456b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -129,6 +129,9 @@ public List generate() { if (info.getVersion() != null) { config.additionalProperties().put("version", info.getVersion()); } + if (info.getTermsOfService() != null) { + config.additionalProperties().put("termsOfService", info.getTermsOfService()); + } } StringBuilder hostBuilder = new StringBuilder(); diff --git a/modules/swagger-codegen/src/main/resources/ruby/api.mustache b/modules/swagger-codegen/src/main/resources/ruby/api.mustache index 85eeec8b962..a48dfd565c0 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + require "uri" module {{moduleName}} diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache index 2ad1491ee1a..d0ad5abf771 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + require 'date' require 'json' require 'logger' diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_error.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_error.mustache index f8b598dad71..ddd8cda32f5 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_error.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_error.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + module {{moduleName}} class ApiError < StandardError attr_reader :code, :response_headers, :response_body diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache new file mode 100644 index 00000000000..28301757e70 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ruby/api_info.mustache @@ -0,0 +1,18 @@ +{{#appName}}{{{appName}}} + +{{/appName}} +{{#appDescription}}{{{appDescription}}} + +{{/appDescription}} +{{#version}}OpenAPI spec version: {{version}}{{/version}} +{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +Generated by: https://github.com/swagger-api/swagger-codegen.git + +{{#licenseInfo}} +License: {{{licenseInfo}}} +{{#licenseUrl}}{{licenseUrl}}{{/licenseUrl}} + +{{/licenseInfo}} +{{#termsOfService}} +Terms of Service: {{{termsOfService}}} +{{/termsOfService}} diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_test.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_test.mustache index d6528ee9312..7e95c2d6446 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_test.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + require 'spec_helper' require 'json' diff --git a/modules/swagger-codegen/src/main/resources/ruby/gem.mustache b/modules/swagger-codegen/src/main/resources/ruby/gem.mustache index ec5ee0ac17c..db694b7355d 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/gem.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/gem.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + # Common files require '{{gemName}}/api_client' require '{{gemName}}/api_error' diff --git a/modules/swagger-codegen/src/main/resources/ruby/model.mustache b/modules/swagger-codegen/src/main/resources/ruby/model.mustache index 21de688e525..86567e1d594 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/model.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/model.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + require 'date' module {{moduleName}}{{#models}}{{#model}}{{#description}} diff --git a/modules/swagger-codegen/src/main/resources/ruby/model_test.mustache b/modules/swagger-codegen/src/main/resources/ruby/model_test.mustache index 53860a2494e..f5204447975 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/model_test.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + require 'spec_helper' require 'json' require 'date' diff --git a/modules/swagger-codegen/src/main/resources/ruby/version.mustache b/modules/swagger-codegen/src/main/resources/ruby/version.mustache index 67cfc8ea325..982bcdb3e52 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/version.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/version.mustache @@ -1,3 +1,7 @@ +=begin +{{> api_info}} +=end + module {{moduleName}} VERSION = "{{gemVersion}}" end diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 82d51d44124..7b24a5750d3 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + # Common files require 'petstore/api_client' require 'petstore/api_error' 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 48c4042c1b4..f6d3a52a760 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require "uri" module Petstore 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 18ad29af7e9..40c27f23f8e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require "uri" module Petstore diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index 7b44fa8808a..edd110768e6 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require "uri" module Petstore diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 09d5777f5e8..7ed05c09941 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'date' require 'json' require 'logger' diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index e1b6b3acfd6..b05ca2fdaf6 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + module Petstore class ApiError < StandardError attr_reader :code, :response_headers, :response_body diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 2e6effd24c0..01126b58e89 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'date' module Petstore diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 0ff43744c75..fd6264496d5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'date' module Petstore diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index cba403d7e28..380d740fb97 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'date' module Petstore diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index a821b665d17..9289df5c01b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'date' module Petstore diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 1959adeaa42..742a16b3b2d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'date' module Petstore diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index fed78553ed3..2c3d31c3399 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + module Petstore VERSION = "1.0.0" end diff --git a/samples/client/petstore/ruby/spec/api/PetApi_spec.rb b/samples/client/petstore/ruby/spec/api/PetApi_spec.rb index 98617c4af7d..457be15f9a4 100644 --- a/samples/client/petstore/ruby/spec/api/PetApi_spec.rb +++ b/samples/client/petstore/ruby/spec/api/PetApi_spec.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'spec_helper' require 'json' diff --git a/samples/client/petstore/ruby/spec/api/StoreApi_spec.rb b/samples/client/petstore/ruby/spec/api/StoreApi_spec.rb index 3a80ce52a79..81ba5f07f0d 100644 --- a/samples/client/petstore/ruby/spec/api/StoreApi_spec.rb +++ b/samples/client/petstore/ruby/spec/api/StoreApi_spec.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'spec_helper' require 'json' diff --git a/samples/client/petstore/ruby/spec/api/UserApi_spec.rb b/samples/client/petstore/ruby/spec/api/UserApi_spec.rb index 493a3b28ae5..894a62f6cc0 100644 --- a/samples/client/petstore/ruby/spec/api/UserApi_spec.rb +++ b/samples/client/petstore/ruby/spec/api/UserApi_spec.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'spec_helper' require 'json' diff --git a/samples/client/petstore/ruby/spec/models/Category_spec.rb b/samples/client/petstore/ruby/spec/models/Category_spec.rb index 80c6301499a..5c99a87bf86 100644 --- a/samples/client/petstore/ruby/spec/models/Category_spec.rb +++ b/samples/client/petstore/ruby/spec/models/Category_spec.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'spec_helper' require 'json' require 'date' diff --git a/samples/client/petstore/ruby/spec/models/Order_spec.rb b/samples/client/petstore/ruby/spec/models/Order_spec.rb index 19dd6411267..a78677410ef 100644 --- a/samples/client/petstore/ruby/spec/models/Order_spec.rb +++ b/samples/client/petstore/ruby/spec/models/Order_spec.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'spec_helper' require 'json' require 'date' diff --git a/samples/client/petstore/ruby/spec/models/Pet_spec.rb b/samples/client/petstore/ruby/spec/models/Pet_spec.rb index df597798b9c..f78259b5910 100644 --- a/samples/client/petstore/ruby/spec/models/Pet_spec.rb +++ b/samples/client/petstore/ruby/spec/models/Pet_spec.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'spec_helper' require 'json' require 'date' diff --git a/samples/client/petstore/ruby/spec/models/Tag_spec.rb b/samples/client/petstore/ruby/spec/models/Tag_spec.rb index 56be89ef6cb..e13c9169b8f 100644 --- a/samples/client/petstore/ruby/spec/models/Tag_spec.rb +++ b/samples/client/petstore/ruby/spec/models/Tag_spec.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'spec_helper' require 'json' require 'date' diff --git a/samples/client/petstore/ruby/spec/models/User_spec.rb b/samples/client/petstore/ruby/spec/models/User_spec.rb index 8d33ce00f5f..1d02e14e03a 100644 --- a/samples/client/petstore/ruby/spec/models/User_spec.rb +++ b/samples/client/petstore/ruby/spec/models/User_spec.rb @@ -1,3 +1,19 @@ +=begin +Swagger Petstore + +This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + +OpenAPI spec version: 1.0.0 +Contact: apiteam@swagger.io +Generated by: https://github.com/swagger-api/swagger-codegen.git + +License: Apache 2.0 +http://www.apache.org/licenses/LICENSE-2.0.html + +Terms of Service: http://swagger.io/terms/ + +=end + require 'spec_helper' require 'json' require 'date'