From 57fa91e3961aafb943a3fc21f42c90830fdff5f5 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 12:20:44 +0800 Subject: [PATCH 01/13] add tests to operation servers in ruby client --- .circleci/config.yml | 6 + ...ith-fake-endpoints-models-for-testing.yaml | 45 +++++ .../ruby/lib/petstore/configuration.rb | 183 ++++++++++++++++++ .../ruby/spec/custom/configuration_spec.rb | 2 +- .../petstore/ruby/spec/custom/pet_spec.rb | 43 ++++ 5 files changed, 278 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2649197674a0..d49a1328e0eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,6 +40,12 @@ commands: # a reusable command with parameters - run: command: |- printf '127.0.0.1 petstore.swagger.io + 127.0.0.1 operation1.test.openapi-generator.tech + 127.0.0.1 operation2.test.openapi-generator.tech + 127.0.0.111 operation3.test.openapi-generator.tech + 127.0.0.1 server1.test.openapi-generator.tech + 127.0.0.1 server2.test.openapi-generator.tech + 127.0.0.111 server3.test.openapi-generator.tech ' | sudo tee -a /etc/hosts # - run: docker pull openapitools/openapi-petstore # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore diff --git a/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml index 0c8345a80f55..d8f89b6891b9 100644 --- a/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml @@ -48,6 +48,15 @@ paths: - 80 - 8080 default: 80 + - url: 'http://path.{version}.test.openapi-generator.tech/v2' + description: test server with variables + variables: + version: + description: target server + enum: + - 'v1' + - 'v2' + default: 'v2' post: tags: - pet @@ -178,6 +187,33 @@ paths: - 'read:pets' deprecated: true '/pet/{petId}': + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/' + - url: 'http://{server}.swagger.io:{port}/v2' + description: test server with variables + variables: + server: + description: target server + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: 'http://path.{version}.test.openapi-generator.tech/v2' + description: test server with variables + variables: + version: + description: target server + enum: + - 'v1' + - 'v2' + default: 'v2' get: tags: - pet @@ -1256,6 +1292,15 @@ servers: default: 'v2' - url: https://127.0.0.1/no_varaible description: The local server without variables + - url: http://server.{version}.openapi-generator.tech + description: The openapi-generator test server + variables: + version: + description: target server + enum: + - 'v1' + - 'v2' + default: 'v2' components: requestBodies: UserArray: diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 8b2780ab1490..830c4c9b7f79 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -316,6 +316,20 @@ def server_settings { url: "https://127.0.0.1/no_varaible", description: "The local server without variables", + }, + { + url: "http://server.{version}.openapi-generator.tech", + description: "The openapi-generator test server", + variables: { + version: { + description: "target server", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } } ] end @@ -353,6 +367,114 @@ def operation_server_settings ] } } + }, + { + url: "http://path.{version}.test.openapi-generator.tech/v2", + description: "test server with variables", + variables: { + version: { + description: "target server", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } + } + ], + "PetApi.delete_pet": [ + { + url: "http://petstore.swagger.io/v2", + description: "No description provided", + }, + { + url: "http://path-server-test.petstore.local/v2", + description: "No description provided", + }, + { + url: "http://{server}.swagger.io:{port}/v2", + description: "test server with variables", + variables: { + server: { + description: "target server", + default_value: "petstore", + enum_values: [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + port: { + description: "No description provided", + default_value: "80", + enum_values: [ + "80", + "8080" + ] + } + } + }, + { + url: "http://path.{version}.test.openapi-generator.tech/v2", + description: "test server with variables", + variables: { + version: { + description: "target server", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } + } + ], + "PetApi.get_pet_by_id": [ + { + url: "http://petstore.swagger.io/v2", + description: "No description provided", + }, + { + url: "http://path-server-test.petstore.local/v2", + description: "No description provided", + }, + { + url: "http://{server}.swagger.io:{port}/v2", + description: "test server with variables", + variables: { + server: { + description: "target server", + default_value: "petstore", + enum_values: [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + port: { + description: "No description provided", + default_value: "80", + enum_values: [ + "80", + "8080" + ] + } + } + }, + { + url: "http://path.{version}.test.openapi-generator.tech/v2", + description: "test server with variables", + variables: { + version: { + description: "target server", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } } ], "PetApi.update_pet": [ @@ -386,6 +508,67 @@ def operation_server_settings ] } } + }, + { + url: "http://path.{version}.test.openapi-generator.tech/v2", + description: "test server with variables", + variables: { + version: { + description: "target server", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } + } + ], + "PetApi.update_pet_with_form": [ + { + url: "http://petstore.swagger.io/v2", + description: "No description provided", + }, + { + url: "http://path-server-test.petstore.local/v2", + description: "No description provided", + }, + { + url: "http://{server}.swagger.io:{port}/v2", + description: "test server with variables", + variables: { + server: { + description: "target server", + default_value: "petstore", + enum_values: [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + port: { + description: "No description provided", + default_value: "80", + enum_values: [ + "80", + "8080" + ] + } + } + }, + { + url: "http://path.{version}.test.openapi-generator.tech/v2", + description: "test server with variables", + variables: { + version: { + description: "target server", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } } ], } diff --git a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb index 594053131277..5ee8f3ea1c4e 100644 --- a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb @@ -61,7 +61,7 @@ } expect { config.base_url(:'PetApi.add_pet') - }.to raise_error(ArgumentError, 'Invalid index 10 when selecting the server. Must not be nil and must be less than 3') + }.to raise_error(ArgumentError, 'Invalid index 10 when selecting the server. Must not be nil and must be less than 4') end it 'should remove trailing slashes' do diff --git a/samples/client/petstore/ruby/spec/custom/pet_spec.rb b/samples/client/petstore/ruby/spec/custom/pet_spec.rb index 1fbec557bee4..ae2285d74257 100644 --- a/samples/client/petstore/ruby/spec/custom/pet_spec.rb +++ b/samples/client/petstore/ruby/spec/custom/pet_spec.rb @@ -60,6 +60,49 @@ expect(pet.category.name).to eq("category test") end + it "should fetch a pet object using invalid operation path" do + # backup index + index_backup = @pet_api.api_client.config.server_operation_index + expect(index_backup).to eq({}) + # test operation index 1 (invalid path) + @pet_api.api_client.config.server_operation_index = { + :'PetApi.get_pet_by_id' => 1 + } + + expect(@pet_api.api_client.config.base_url(:'PetApi.get_pet_by_id')).to eq('http://path-server-test.petstore.local/v2') + + expect { + pet = @pet_api.get_pet_by_id(@pet_id) + }.to raise_error(Petstore::ApiError) # path-server-test.petstore.local is invalid (not defined in host table) + + # restore index + @pet_api.api_client.config.server_operation_index = index_backup + expect(@pet_api.api_client.config.server_operation_index).to eq({}) + end + + it "should fetch a pet object using operation path" do + # backup index + index_backup = @pet_api.api_client.config.server_operation_index + expect(index_backup).to eq({}) + # test operation index 3 + @pet_api.api_client.config.server_operation_index = { + :'PetApi.get_pet_by_id' => 3 + } + + expect(@pet_api.api_client.config.base_url(:'PetApi.get_pet_by_id')).to eq('http://path.v2.test.openapi-generator.tech/v2') + + pet = @pet_api.get_pet_by_id(@pet_id) + expect(pet).to be_a(Petstore::Pet) + expect(pet.id).to eq(@pet_id) + expect(pet.name).to eq("RUBY UNIT TESTING") + expect(pet.tags[0].name).to eq("tag test") + expect(pet.category.name).to eq("category test") + # restore index + @pet_api.api_client.config.server_operation_index = index_backup + expect(@pet_api.api_client.config.server_operation_index).to eq({}) + expect(@pet_api.api_client.config.base_url(:'PetApi.get_pet_by_id')).to eq('http://petstore.swagger.io/v2') + end + it "should fetch a pet object with http info" do pet, status_code, headers = @pet_api.get_pet_by_id_with_http_info(@pet_id) expect(status_code).to eq(200) From 9ac4f5e682d329b8dc9f560566e6433c0f69d4fc Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 12:34:34 +0800 Subject: [PATCH 02/13] update samples --- samples/client/petstore/ruby/lib/petstore/configuration.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 830c4c9b7f79..82db3aaea9ac 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -389,7 +389,7 @@ def operation_server_settings description: "No description provided", }, { - url: "http://path-server-test.petstore.local/v2", + url: "http://path-server-test.petstore.local/", description: "No description provided", }, { @@ -436,7 +436,7 @@ def operation_server_settings description: "No description provided", }, { - url: "http://path-server-test.petstore.local/v2", + url: "http://path-server-test.petstore.local/", description: "No description provided", }, { @@ -530,7 +530,7 @@ def operation_server_settings description: "No description provided", }, { - url: "http://path-server-test.petstore.local/v2", + url: "http://path-server-test.petstore.local/", description: "No description provided", }, { From 87401c05fee0cdfc24a64c8b04cf758244ba4268 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 12:37:51 +0800 Subject: [PATCH 03/13] revert change in spec, remove invalid? check in anyof model --- .../resources/ruby-client/partial_anyof_module.mustache | 2 +- .../petstore-with-fake-endpoints-models-for-testing.yaml | 2 +- samples/client/petstore/ruby/lib/petstore/configuration.rb | 6 +++--- .../petstore/ruby/lib/petstore/models/mammal_anyof.rb | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/ruby-client/partial_anyof_module.mustache b/modules/openapi-generator/src/main/resources/ruby-client/partial_anyof_module.mustache index ccd63dc0d85f..b41dd20a7d08 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/partial_anyof_module.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/partial_anyof_module.mustache @@ -81,7 +81,7 @@ # raise if data contains keys that are not known to the model raise unless (data.keys - const.acceptable_attributes).empty? model = const.build_from_hash(data) - return model if model && model.valid? + return model if model end end end diff --git a/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml index d8f89b6891b9..64dc36b34115 100644 --- a/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml @@ -189,7 +189,7 @@ paths: '/pet/{petId}': servers: - url: 'http://petstore.swagger.io/v2' - - url: 'http://path-server-test.petstore.local/' + - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' description: test server with variables variables: diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 82db3aaea9ac..830c4c9b7f79 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -389,7 +389,7 @@ def operation_server_settings description: "No description provided", }, { - url: "http://path-server-test.petstore.local/", + url: "http://path-server-test.petstore.local/v2", description: "No description provided", }, { @@ -436,7 +436,7 @@ def operation_server_settings description: "No description provided", }, { - url: "http://path-server-test.petstore.local/", + url: "http://path-server-test.petstore.local/v2", description: "No description provided", }, { @@ -530,7 +530,7 @@ def operation_server_settings description: "No description provided", }, { - url: "http://path-server-test.petstore.local/", + url: "http://path-server-test.petstore.local/v2", description: "No description provided", }, { diff --git a/samples/client/petstore/ruby/lib/petstore/models/mammal_anyof.rb b/samples/client/petstore/ruby/lib/petstore/models/mammal_anyof.rb index 554b05586174..dc19b174a7f7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mammal_anyof.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mammal_anyof.rb @@ -89,7 +89,7 @@ def find_and_cast_into_type(klass, data) # raise if data contains keys that are not known to the model raise unless (data.keys - const.acceptable_attributes).empty? model = const.build_from_hash(data) - return model if model && model.valid? + return model if model end end end From c501beba85e01be377ad124137de74e5209a189c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 12:40:21 +0800 Subject: [PATCH 04/13] fix hsot table --- .circleci/config.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d49a1328e0eb..c09c1fd93ee2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,13 +39,14 @@ commands: # a reusable command with parameters command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - run: command: |- - printf '127.0.0.1 petstore.swagger.io - 127.0.0.1 operation1.test.openapi-generator.tech - 127.0.0.1 operation2.test.openapi-generator.tech - 127.0.0.111 operation3.test.openapi-generator.tech - 127.0.0.1 server1.test.openapi-generator.tech - 127.0.0.1 server2.test.openapi-generator.tech - 127.0.0.111 server3.test.openapi-generator.tech + printf ' +127.0.0.1 petstore.swagger.io +127.0.0.1 operation1.test.openapi-generator.tech +127.0.0.1 operation2.test.openapi-generator.tech +127.0.0.111 operation3.test.openapi-generator.tech +127.0.0.1 server1.test.openapi-generator.tech +127.0.0.1 server2.test.openapi-generator.tech +127.0.0.111 server3.test.openapi-generator.tech ' | sudo tee -a /etc/hosts # - run: docker pull openapitools/openapi-petstore # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore From bbf94720beed488731adbefe499dba60416c487c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 12:42:56 +0800 Subject: [PATCH 05/13] fix circleci config --- .circleci/config.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c09c1fd93ee2..85d43852961e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,14 +39,7 @@ commands: # a reusable command with parameters command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - run: command: |- - printf ' -127.0.0.1 petstore.swagger.io -127.0.0.1 operation1.test.openapi-generator.tech -127.0.0.1 operation2.test.openapi-generator.tech -127.0.0.111 operation3.test.openapi-generator.tech -127.0.0.1 server1.test.openapi-generator.tech -127.0.0.1 server2.test.openapi-generator.tech -127.0.0.111 server3.test.openapi-generator.tech + printf '127.0.0.1 petstore.swagger.io\n127.0.0.1 operation1.test.openapi-generator.tech\n127.0.0.1 operation2.test.openapi-generator.tech\n127.0.0.111 operation3.test.openapi-generator.tech\n127.0.0.1 server1.test.openapi-generator.tech\n127.0.0.1 server2.test.openapi-generator.tech\n127.0.0.111 server3.test.openapi-generator.tech ' | sudo tee -a /etc/hosts # - run: docker pull openapitools/openapi-petstore # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore From dabb1f1ee244c66d8ddfb0a92baa38e9c0939c01 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 12:56:05 +0800 Subject: [PATCH 06/13] fix --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 85d43852961e..53ef1be006ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,8 +39,8 @@ commands: # a reusable command with parameters command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - run: command: |- - printf '127.0.0.1 petstore.swagger.io\n127.0.0.1 operation1.test.openapi-generator.tech\n127.0.0.1 operation2.test.openapi-generator.tech\n127.0.0.111 operation3.test.openapi-generator.tech\n127.0.0.1 server1.test.openapi-generator.tech\n127.0.0.1 server2.test.openapi-generator.tech\n127.0.0.111 server3.test.openapi-generator.tech - ' | sudo tee -a /etc/hosts + printf "127.0.0.1 petstore.swagger.io\n127.0.0.1 operation1.test.openapi-generator.tech\n127.0.0.1 operation2.test.openapi-generator.tech\n127.0.0.111 operation3.test.openapi-generator.tech\n127.0.0.1 server1.test.openapi-generator.tech\n127.0.0.1 server2.test.openapi-generator.tech\n127.0.0.111 server3.test.openapi-generator.tech + " | sudo tee -a /etc/hosts # - run: docker pull openapitools/openapi-petstore # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore - run: docker pull swaggerapi/petstore From 677fcbb361e03290372204700643e76f25f49851 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 13:20:23 +0800 Subject: [PATCH 07/13] fix host table --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53ef1be006ac..b20475ff38c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,9 +38,10 @@ commands: # a reusable command with parameters - run: command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - run: - command: |- - printf "127.0.0.1 petstore.swagger.io\n127.0.0.1 operation1.test.openapi-generator.tech\n127.0.0.1 operation2.test.openapi-generator.tech\n127.0.0.111 operation3.test.openapi-generator.tech\n127.0.0.1 server1.test.openapi-generator.tech\n127.0.0.1 server2.test.openapi-generator.tech\n127.0.0.111 server3.test.openapi-generator.tech - " | sudo tee -a /etc/hosts + command: | + #printf "127.0.0.1 petstore.swagger.io\n127.0.0.1 operation1.test.openapi-generator.tech\n127.0.0.1 operation2.test.openapi-generator.tech\n127.0.0.111 operation3.test.openapi-generator.tech\n127.0.0.1 server1.test.openapi-generator.tech\n127.0.0.1 server2.test.openapi-generator.tech\n127.0.0.111 server3.test.openapi-generator.tech + sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io\n127.0.0.1 operation1.test.openapi-generator.tech\n127.0.0.1 operation2.test.openapi-generator.tech\n127.0.0.111 operation3.test.openapi-generator.tech\n127.0.0.1 server1.test.openapi-generator.tech\n127.0.0.1 server2.test.openapi-generator.tech\n127.0.0.111 server3.test.openapi-generator.tech" + cat /etc/hosts # - run: docker pull openapitools/openapi-petstore # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore - run: docker pull swaggerapi/petstore From 874fa58a48f7fb0619064307a7cb139c2fea64e5 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 13:29:14 +0800 Subject: [PATCH 08/13] fix host table --- .circleci/config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b20475ff38c4..0cbf157445f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,8 +39,13 @@ commands: # a reusable command with parameters command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - run: command: | - #printf "127.0.0.1 petstore.swagger.io\n127.0.0.1 operation1.test.openapi-generator.tech\n127.0.0.1 operation2.test.openapi-generator.tech\n127.0.0.111 operation3.test.openapi-generator.tech\n127.0.0.1 server1.test.openapi-generator.tech\n127.0.0.1 server2.test.openapi-generator.tech\n127.0.0.111 server3.test.openapi-generator.tech - sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io\n127.0.0.1 operation1.test.openapi-generator.tech\n127.0.0.1 operation2.test.openapi-generator.tech\n127.0.0.111 operation3.test.openapi-generator.tech\n127.0.0.1 server1.test.openapi-generator.tech\n127.0.0.1 server2.test.openapi-generator.tech\n127.0.0.111 server3.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io" + sudo tee -a /etc/hosts \<<< "127.0.0.1 operation1.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 operation2.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 operation3.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 server1.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 server2.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 server3.test.openapi-generator.tech" cat /etc/hosts # - run: docker pull openapitools/openapi-petstore # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore From eacd46f2b980b3d1d9838759c7cfbaf184a2b5f9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 13:35:22 +0800 Subject: [PATCH 09/13] minor fix --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0cbf157445f3..6cb1861833c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,10 +42,10 @@ commands: # a reusable command with parameters sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io" sudo tee -a /etc/hosts \<<< "127.0.0.1 operation1.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 operation2.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.1 operation3.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.111 operation3.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 server1.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 server2.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.1 server3.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.111 server3.test.openapi-generator.tech" cat /etc/hosts # - run: docker pull openapitools/openapi-petstore # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore From e41b43fde61abd18bba2f6b9adbadbd2aeaf19d1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 13:47:02 +0800 Subject: [PATCH 10/13] fix --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6cb1861833c2..feb0262cf94f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,6 +40,9 @@ commands: # a reusable command with parameters - run: command: | sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io" + sudo tee -a /etc/hosts \<<< "127.0.0.1 path1.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 path2.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.111 path3.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 operation1.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 operation2.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.111 operation3.test.openapi-generator.tech" From abe41ec73870b772529b217b04b8da6b116d4ced Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 15:42:26 +0800 Subject: [PATCH 11/13] reorder --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index feb0262cf94f..f481f37bf171 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,7 +39,6 @@ commands: # a reusable command with parameters command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - run: command: | - sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io" sudo tee -a /etc/hosts \<<< "127.0.0.1 path1.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 path2.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.111 path3.test.openapi-generator.tech" @@ -49,6 +48,7 @@ commands: # a reusable command with parameters sudo tee -a /etc/hosts \<<< "127.0.0.1 server1.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 server2.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.111 server3.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io" cat /etc/hosts # - run: docker pull openapitools/openapi-petstore # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore From 76955c943d5cffad7d42e3d7b45909010532406d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 15:58:28 +0800 Subject: [PATCH 12/13] update --- .circleci/config.yml | 18 +++++++++--------- pom.xml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f481f37bf171..70271c050ec3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,15 +39,15 @@ commands: # a reusable command with parameters command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - run: command: | - sudo tee -a /etc/hosts \<<< "127.0.0.1 path1.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.1 path2.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.111 path3.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.1 operation1.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.1 operation2.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.111 operation3.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.1 server1.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.1 server2.test.openapi-generator.tech" - sudo tee -a /etc/hosts \<<< "127.0.0.111 server3.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.1 path1.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.1 path2.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.111 path3.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.1 operation1.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.1 operation2.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.111 operation3.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.1 server1.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.1 server2.test.openapi-generator.tech" + #sudo tee -a /etc/hosts \<<< "127.0.0.111 server3.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io" cat /etc/hosts # - run: docker pull openapitools/openapi-petstore diff --git a/pom.xml b/pom.xml index 90fc1d49803d..53b79aedd7a5 100644 --- a/pom.xml +++ b/pom.xml @@ -1192,8 +1192,8 @@ - samples/client/petstore/ruby-faraday samples/client/petstore/ruby + samples/client/petstore/ruby-faraday samples/client/petstore/ruby-autoload From 686a937faddad4fe84d197ce77e8f93579108135 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jul 2023 16:06:31 +0800 Subject: [PATCH 13/13] fix --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70271c050ec3..bcf8db2b1586 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,15 +39,15 @@ commands: # a reusable command with parameters command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - run: command: | - #sudo tee -a /etc/hosts \<<< "127.0.0.1 path1.test.openapi-generator.tech" - #sudo tee -a /etc/hosts \<<< "127.0.0.1 path2.test.openapi-generator.tech" - #sudo tee -a /etc/hosts \<<< "127.0.0.111 path3.test.openapi-generator.tech" - #sudo tee -a /etc/hosts \<<< "127.0.0.1 operation1.test.openapi-generator.tech" - #sudo tee -a /etc/hosts \<<< "127.0.0.1 operation2.test.openapi-generator.tech" - #sudo tee -a /etc/hosts \<<< "127.0.0.111 operation3.test.openapi-generator.tech" - #sudo tee -a /etc/hosts \<<< "127.0.0.1 server1.test.openapi-generator.tech" - #sudo tee -a /etc/hosts \<<< "127.0.0.1 server2.test.openapi-generator.tech" - #sudo tee -a /etc/hosts \<<< "127.0.0.111 server3.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 path.v1.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 path.v2.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.111 path.v3.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 operation.v1.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 operation.v2.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.111 operation.v3.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 server.v1.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.1 server.v2.test.openapi-generator.tech" + sudo tee -a /etc/hosts \<<< "127.0.0.111 server.v3.test.openapi-generator.tech" sudo tee -a /etc/hosts \<<< "127.0.0.1 petstore.swagger.io" cat /etc/hosts # - run: docker pull openapitools/openapi-petstore