diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index b16f8751308..1c6d9331151 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1135,6 +1135,8 @@ servers: - 'v1' - 'v2' default: 'v2' + - url: https://127.0.0.1/no_variable + description: The local server without variables components: requestBodies: UserArray: diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 81c4cf697c0..b267c0bea13 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1120,6 +1120,8 @@ servers: - 'v1' - 'v2' default: 'v2' + - url: https://127.0.0.1/no_variable + description: The local server without variables components: requestBodies: UserArray: diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 5ee649052b2..a8449a1cbad 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1142,6 +1142,8 @@ servers: - 'v1' - 'v2' default: 'v2' + - url: https://127.0.0.1/no_varaible + description: The local server without variables components: requestBodies: UserArray: diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs index ff0b02cd6ef..d9463d9d836 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs @@ -167,6 +167,12 @@ namespace Org.OpenAPITools.Client } } } + }, + { + new Dictionary { + {"url", "https://127.0.0.1/no_variable"}, + {"description", "The local server without variables"}, + } } }; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs index dacc721f192..f5507fae90a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs @@ -172,6 +172,12 @@ namespace Org.OpenAPITools.Client } } } + }, + { + new Dictionary { + {"url", "https://127.0.0.1/no_variable"}, + {"description", "The local server without variables"}, + } } }; diff --git a/samples/client/petstore/javascript-es6/src/ApiClient.js b/samples/client/petstore/javascript-es6/src/ApiClient.js index 6fba8796f92..a750c17c975 100644 --- a/samples/client/petstore/javascript-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-es6/src/ApiClient.js @@ -615,6 +615,10 @@ class ApiClient { ] } } + }, + { + 'url': "https://127.0.0.1/no_varaible", + 'description': "The local server without variables", } ]; } diff --git a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js index 1b38bc4b28e..390d96b3e33 100644 --- a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js @@ -616,6 +616,10 @@ class ApiClient { ] } } + }, + { + 'url': "https://127.0.0.1/no_varaible", + 'description': "The local server without variables", } ]; } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 1163536b36e..715f6db68ab 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -474,6 +474,10 @@ class Configuration ] ] ] + ], + [ + "url" => "https://127.0.0.1/no_varaible", + "description" => "The local server without variables", ] ]; } diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php index 4cc9954e90e..eedbca0a89f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/ConfigurationTest.php @@ -15,7 +15,7 @@ class ConfigurationTest extends TestCase $config = new Configuration(); $servers = $config->getHostSettings(); - $this->assertCount(2, $servers); + $this->assertCount(3, $servers); $this->assertSame("http://{server}.swagger.io:{port}/v2", $servers[0]["url"]); $this->assertSame("petstore", $servers[0]["variables"]["server"]["default_value"]); $this->assertSame("80", $servers[0]["variables"]["port"]["default_value"]); @@ -47,13 +47,13 @@ class ConfigurationTest extends TestCase public function testInvalidIndex() { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid index 2 when selecting the host. Must be less than 2'); + $this->expectExceptionMessage('Invalid index 3 when selecting the host. Must be less than 3'); $config = new Configuration(); - $url = $config->getHostFromSettings(2); + $url = $config->getHostFromSettings(3); } /** - * Test host settings with invalid vaues + * Test host settings with invalid values */ public function testHostUrlWithInvalidValues() { diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 0620549939a..6724d47829a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -286,6 +286,10 @@ module Petstore ] } } + }, + { + url: "https://127.0.0.1/no_varaible", + description: "The local server without variables", } ] end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index a46aa40930c..03b62151ccc 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -291,6 +291,10 @@ module Petstore ] } } + }, + { + url: "https://127.0.0.1/no_varaible", + description: "The local server without variables", } ] end diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 4bb7abdc392..6777d5fdc64 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -31,6 +31,8 @@ servers: enum: - v1 - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable tags: - description: Everything about your Pets name: pet diff --git a/samples/openapi3/client/petstore/go/go-petstore/configuration.go b/samples/openapi3/client/petstore/go/go-petstore/configuration.go index cb9680e3094..77f753a1bf5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/configuration.go +++ b/samples/openapi3/client/petstore/go/go-petstore/configuration.go @@ -141,6 +141,10 @@ func NewConfiguration() *Configuration { }, }, }, + { + URL: "https://127.0.0.1/no_variable", + Description: "The local server without variables", + }, }, OperationServers: map[string]ServerConfigurations{ "PetApiService.AddPet": { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml index f22df8f6bbd..b95a10933d5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -31,6 +31,8 @@ servers: enum: - v1 - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable tags: - description: Everything about your Pets name: pet diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 8539f7f9a3f..f52640fad1c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -116,6 +116,11 @@ public class ApiClient extends JavaTimeFormatter { ) )); }} + ), + new ServerConfiguration( + "https://127.0.0.1/no_variable", + "The local server without variables", + new HashMap() ) )); protected Integer serverIndex = 0; diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 4aca4242723..e889b494727 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -556,6 +556,10 @@ conf = petstore_api.Configuration( ] } } + }, + { + 'url': "https://127.0.0.1/no_varaible", + 'description': "The local server without variables", } ]