From dceb03a8f05a8900e89e96bd4c367581f91dd6a9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 16:33:18 +0800 Subject: [PATCH 01/17] migrate ruby tests to github workflow --- .github/workflows/samples-ruby.yaml | 44 +++++++++---------- .../petstore/ruby/.openapi-generator-ignore | 4 ++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/samples-ruby.yaml b/.github/workflows/samples-ruby.yaml index e2354bfbd42b..3e1f9caaa7e8 100644 --- a/.github/workflows/samples-ruby.yaml +++ b/.github/workflows/samples-ruby.yaml @@ -1,16 +1,18 @@ -name: Samples Ruby +name: Samples Ruby on: push: paths: - - 'samples/client/echo_api/ruby-httpx/**' - - 'samples/client/echo_api/ruby-faraday/**' - - 'samples/client/echo_api/ruby-typhoeus/**' + - samples/client/petstore/ruby/** + - samples/client/petstore/ruby-faraday/** + - samples/client/petstore/ruby-httpx/** + - samples/client/petstore/ruby-autoload/** pull_request: paths: - - 'samples/client/echo_api/ruby-httpx/**' - - 'samples/client/echo_api/ruby-faraday/**' - - 'samples/client/echo_api/ruby-typhoeus/**' + - samples/client/petstore/ruby/** + - samples/client/petstore/ruby-faraday/** + - samples/client/petstore/ruby-httpx/** + - samples/client/petstore/ruby-autoload/** jobs: build: @@ -20,24 +22,18 @@ jobs: fail-fast: false matrix: sample: - - 'samples/client/echo_api/ruby-httpx/' - - 'samples/client/echo_api/ruby-faraday/' - - 'samples/client/echo_api/ruby-typhoeus/' + - samples/client/petstore/ruby/ + - samples/client/petstore/ruby-faraday/ + - samples/client/petstore/ruby-httpx/ + - samples/client/petstore/ruby-autoload/ steps: - uses: actions/checkout@v5 - - name: Setup node.js - uses: actions/setup-node@v5 - - name: Run echo server - run: | - git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server - (cd http-echo-server && npm install && npm start &) - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.0 - bundler-cache: true - - name: Install bundle + ruby-version: '3.2' # Not needed with a .ruby-version, .tool-versions or mise.toml + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run test working-directory: ${{ matrix.sample }} - run: bundle install - - name: Run rspec - working-directory: ${{ matrix.sample }} - run: rspec + run: bundle exec rake + + diff --git a/samples/client/petstore/ruby/.openapi-generator-ignore b/samples/client/petstore/ruby/.openapi-generator-ignore index 7484ee590a38..5a9f4cf07bc2 100644 --- a/samples/client/petstore/ruby/.openapi-generator-ignore +++ b/samples/client/petstore/ruby/.openapi-generator-ignore @@ -21,3 +21,7 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +# +# +# +# From 33fdad9554318b0c1b2124dc7bc9f264dc4754a6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 16:35:55 +0800 Subject: [PATCH 02/17] add echo client tests --- .../samples-ruby-client-echo-api.yaml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/samples-ruby-client-echo-api.yaml diff --git a/.github/workflows/samples-ruby-client-echo-api.yaml b/.github/workflows/samples-ruby-client-echo-api.yaml new file mode 100644 index 000000000000..0f07b1cae357 --- /dev/null +++ b/.github/workflows/samples-ruby-client-echo-api.yaml @@ -0,0 +1,43 @@ +name: Samples Ruby + +on: + push: + paths: + - 'samples/client/echo_api/ruby-httpx/**' + - 'samples/client/echo_api/ruby-faraday/**' + - 'samples/client/echo_api/ruby-typhoeus/**' + pull_request: + paths: + - 'samples/client/echo_api/ruby-httpx/**' + - 'samples/client/echo_api/ruby-faraday/**' + - 'samples/client/echo_api/ruby-typhoeus/**' + +jobs: + build: + name: Build Ruby + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - 'samples/client/echo_api/ruby-httpx/' + - 'samples/client/echo_api/ruby-faraday/' + - 'samples/client/echo_api/ruby-typhoeus/' + steps: + - uses: actions/checkout@v5 + - name: Setup node.js + uses: actions/setup-node@v5 + - name: Run echo server + run: | + git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server + (cd http-echo-server && npm install && npm start &) + - uses: actions/setup-ruby@v1 + with: + ruby-version: 3.2 + bundler-cache: true + - name: Install bundle + working-directory: ${{ matrix.sample }} + run: bundle install + - name: Run rspec + working-directory: ${{ matrix.sample }} + run: rspec From 2b3947ea1abecc50f3446a59a333603d6e0b4f34 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 16:38:06 +0800 Subject: [PATCH 03/17] fix workflow --- .github/workflows/samples-ruby.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/samples-ruby.yaml b/.github/workflows/samples-ruby.yaml index 3e1f9caaa7e8..0998e572735f 100644 --- a/.github/workflows/samples-ruby.yaml +++ b/.github/workflows/samples-ruby.yaml @@ -32,8 +32,9 @@ jobs: with: ruby-version: '3.2' # Not needed with a .ruby-version, .tool-versions or mise.toml bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Run test + - name: Install bundle working-directory: ${{ matrix.sample }} - run: bundle exec rake - - + run: bundle install + - name: Run rspec + working-directory: ${{ matrix.sample }} + run: rspec From c2a8e11b45712fcb40322cbcff47fabe861e2429 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 16:39:50 +0800 Subject: [PATCH 04/17] add petstore, update host table --- .github/workflows/samples-ruby.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/samples-ruby.yaml b/.github/workflows/samples-ruby.yaml index 0998e572735f..383a3ac52cb6 100644 --- a/.github/workflows/samples-ruby.yaml +++ b/.github/workflows/samples-ruby.yaml @@ -26,8 +26,19 @@ jobs: - samples/client/petstore/ruby-faraday/ - samples/client/petstore/ruby-httpx/ - samples/client/petstore/ruby-autoload/ + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 + - name: Add hosts to /etc/hosts + run: | + sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts - uses: ruby/setup-ruby@v1 with: ruby-version: '3.2' # Not needed with a .ruby-version, .tool-versions or mise.toml From 9d29eb98bccf88a1321ac9a82a0c8e4d2915e73a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 16:44:59 +0800 Subject: [PATCH 05/17] localhost --- ...ith-fake-endpoints-models-for-testing.yaml | 3 +++ samples/client/petstore/ruby-httpx/README.md | 2 +- .../ruby-httpx/docs/AnotherFakeApi.md | 2 +- .../petstore/ruby-httpx/docs/DefaultApi.md | 2 +- .../petstore/ruby-httpx/docs/FakeApi.md | 2 +- .../docs/FakeClassnameTags123Api.md | 2 +- .../client/petstore/ruby-httpx/docs/PetApi.md | 2 +- .../petstore/ruby-httpx/docs/StoreApi.md | 2 +- .../petstore/ruby-httpx/docs/UserApi.md | 2 +- .../ruby-httpx/lib/petstore/configuration.rb | 26 ++++++++++++++++++- samples/client/petstore/ruby/README.md | 2 +- .../petstore/ruby/docs/AnotherFakeApi.md | 2 +- .../client/petstore/ruby/docs/DefaultApi.md | 2 +- samples/client/petstore/ruby/docs/FakeApi.md | 2 +- .../ruby/docs/FakeClassnameTags123Api.md | 2 +- samples/client/petstore/ruby/docs/PetApi.md | 2 +- samples/client/petstore/ruby/docs/StoreApi.md | 2 +- samples/client/petstore/ruby/docs/UserApi.md | 2 +- .../ruby/lib/petstore/configuration.rb | 26 ++++++++++++++++++- 19 files changed, 69 insertions(+), 18 deletions(-) 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 064862059da5..5bddaf3cfcea 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 @@ -31,6 +31,7 @@ paths: $ref: '#/components/schemas/Foo' /pet: servers: + - url: 'http://localhost/v2' - url: 'http://petstore.swagger.io/v2' - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' @@ -188,6 +189,7 @@ paths: deprecated: true '/pet/{petId}': servers: + - url: 'http://localhost/v2' - url: 'http://petstore.swagger.io/v2' - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' @@ -1358,6 +1360,7 @@ paths: 200: description: OK servers: + - url: 'http://localhost/v2' - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server variables: diff --git a/samples/client/petstore/ruby-httpx/README.md b/samples/client/petstore/ruby-httpx/README.md index 587ccdfcb967..ede4e77f7529 100644 --- a/samples/client/petstore/ruby-httpx/README.md +++ b/samples/client/petstore/ruby-httpx/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md index 52f3f5a72e9b..958074809225 100644 --- a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md index 86925bb7c887..cffdce1f8060 100644 --- a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md +++ b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/FakeApi.md b/samples/client/petstore/ruby-httpx/docs/FakeApi.md index 1e05788c53ab..ad4bb256e339 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md index 32d3ff8ebdd2..770127d28bd7 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/PetApi.md b/samples/client/petstore/ruby-httpx/docs/PetApi.md index b28334ae2c58..3e1586aab72e 100644 --- a/samples/client/petstore/ruby-httpx/docs/PetApi.md +++ b/samples/client/petstore/ruby-httpx/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/StoreApi.md b/samples/client/petstore/ruby-httpx/docs/StoreApi.md index 52c551498cf0..144421ea306d 100644 --- a/samples/client/petstore/ruby-httpx/docs/StoreApi.md +++ b/samples/client/petstore/ruby-httpx/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/UserApi.md b/samples/client/petstore/ruby-httpx/docs/UserApi.md index 348f5f9c4295..e740c84292fa 100644 --- a/samples/client/petstore/ruby-httpx/docs/UserApi.md +++ b/samples/client/petstore/ruby-httpx/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb index caa1be28dee5..20e6e7ab3f23 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb @@ -128,7 +128,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'petstore.swagger.io' + @host = 'localhost' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -254,6 +254,10 @@ def auth_settings # Returns an array of Server setting def server_settings [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://{server}.swagger.io:{port}/v2", description: "petstore server", @@ -315,6 +319,10 @@ def server_settings def operation_server_settings { "PetApi.add_pet": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -362,6 +370,10 @@ def operation_server_settings } ], "PetApi.delete_pet": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -409,6 +421,10 @@ def operation_server_settings } ], "PetApi.get_pet_by_id": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -456,6 +472,10 @@ def operation_server_settings } ], "PetApi.update_pet": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -503,6 +523,10 @@ def operation_server_settings } ], "PetApi.update_pet_with_form": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 587ccdfcb967..ede4e77f7529 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby/docs/AnotherFakeApi.md b/samples/client/petstore/ruby/docs/AnotherFakeApi.md index 52f3f5a72e9b..958074809225 100644 --- a/samples/client/petstore/ruby/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/DefaultApi.md b/samples/client/petstore/ruby/docs/DefaultApi.md index 86925bb7c887..cffdce1f8060 100644 --- a/samples/client/petstore/ruby/docs/DefaultApi.md +++ b/samples/client/petstore/ruby/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 1dff682f9a2d..bb4542988bb9 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md index 32d3ff8ebdd2..770127d28bd7 100644 --- a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index b28334ae2c58..3e1586aab72e 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 52c551498cf0..144421ea306d 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index 348f5f9c4295..e740c84292fa 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 0756a9271761..519cf11226c8 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -158,7 +158,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'petstore.swagger.io' + @host = 'localhost' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -286,6 +286,10 @@ def auth_settings # Returns an array of Server setting def server_settings [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://{server}.swagger.io:{port}/v2", description: "petstore server", @@ -347,6 +351,10 @@ def server_settings def operation_server_settings { "PetApi.add_pet": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -394,6 +402,10 @@ def operation_server_settings } ], "PetApi.delete_pet": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -441,6 +453,10 @@ def operation_server_settings } ], "PetApi.get_pet_by_id": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -488,6 +504,10 @@ def operation_server_settings } ], "PetApi.update_pet": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -535,6 +555,10 @@ def operation_server_settings } ], "PetApi.update_pet_with_form": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", From 2760903274b48f42bcb6442ae22ae6f186d97941 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 16:48:43 +0800 Subject: [PATCH 06/17] update config to use ruby petstore fake spec --- bin/configs/ruby-faraday.yaml | 2 +- .../ruby-faraday/.openapi-generator/FILES | 28 ++- .../client/petstore/ruby-faraday/README.md | 14 +- .../ruby-faraday/docs/AnotherFakeApi.md | 2 +- .../petstore/ruby-faraday/docs/DefaultApi.md | 2 +- .../petstore/ruby-faraday/docs/FakeApi.md | 134 +++++------ .../docs/FakeClassnameTags123Api.md | 2 +- .../petstore/ruby-faraday/docs/PetApi.md | 2 +- .../petstore/ruby-faraday/docs/StoreApi.md | 2 +- .../petstore/ruby-faraday/docs/UserApi.md | 2 +- .../petstore/ruby-faraday/lib/petstore.rb | 10 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 147 ++++++------ .../lib/petstore/configuration.rb | 209 +++++++++++++++++- 13 files changed, 407 insertions(+), 149 deletions(-) diff --git a/bin/configs/ruby-faraday.yaml b/bin/configs/ruby-faraday.yaml index b289ae977f48..7e7731d61461 100644 --- a/bin/configs/ruby-faraday.yaml +++ b/bin/configs/ruby-faraday.yaml @@ -1,7 +1,7 @@ generatorName: ruby outputDir: samples/client/petstore/ruby-faraday library: faraday -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/ruby-client additionalProperties: gemVersion: 1.0.0 diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index 7dbd2fdcd849..4159374bb74d 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -17,9 +17,9 @@ docs/ArrayTest.md docs/Capitalization.md docs/Cat.md docs/Category.md -docs/ChildWithNullable.md docs/ClassModel.md docs/Client.md +docs/Cow.md docs/DefaultApi.md docs/DeprecatedObject.md docs/Dog.md @@ -37,6 +37,9 @@ docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/List.md +docs/Mammal.md +docs/MammalAnyof.md +docs/MammalWithoutDiscriminator.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md @@ -45,6 +48,7 @@ docs/Name.md docs/NullableClass.md docs/NumberOnly.md docs/ObjectWithDeprecatedFields.md +docs/OneOfPrimitiveTypes.md docs/Order.md docs/OuterComposite.md docs/OuterEnum.md @@ -52,9 +56,9 @@ docs/OuterEnumDefaultValue.md docs/OuterEnumInteger.md docs/OuterEnumIntegerDefaultValue.md docs/OuterObjectWithEnumProperty.md -docs/ParentWithNullable.md docs/Pet.md docs/PetApi.md +docs/PropertyNameMapping.md docs/ReadOnlyFirst.md docs/SingleRefType.md docs/SpecialModelName.md @@ -63,6 +67,8 @@ docs/Tag.md docs/TestInlineFreeformAdditionalPropertiesRequest.md docs/User.md docs/UserApi.md +docs/Whale.md +docs/Zebra.md git_push.sh lib/petstore.rb lib/petstore/api/another_fake_api.rb @@ -85,9 +91,9 @@ lib/petstore/models/array_test.rb lib/petstore/models/capitalization.rb lib/petstore/models/cat.rb lib/petstore/models/category.rb -lib/petstore/models/child_with_nullable.rb lib/petstore/models/class_model.rb lib/petstore/models/client.rb +lib/petstore/models/cow.rb lib/petstore/models/deprecated_object.rb lib/petstore/models/dog.rb lib/petstore/models/enum_arrays.rb @@ -102,6 +108,9 @@ lib/petstore/models/format_test.rb lib/petstore/models/has_only_read_only.rb lib/petstore/models/health_check_result.rb lib/petstore/models/list.rb +lib/petstore/models/mammal.rb +lib/petstore/models/mammal_anyof.rb +lib/petstore/models/mammal_without_discriminator.rb lib/petstore/models/map_test.rb lib/petstore/models/mixed_properties_and_additional_properties_class.rb lib/petstore/models/model200_response.rb @@ -110,6 +119,7 @@ lib/petstore/models/name.rb lib/petstore/models/nullable_class.rb lib/petstore/models/number_only.rb lib/petstore/models/object_with_deprecated_fields.rb +lib/petstore/models/one_of_primitive_types.rb lib/petstore/models/order.rb lib/petstore/models/outer_composite.rb lib/petstore/models/outer_enum.rb @@ -117,14 +127,24 @@ lib/petstore/models/outer_enum_default_value.rb lib/petstore/models/outer_enum_integer.rb lib/petstore/models/outer_enum_integer_default_value.rb lib/petstore/models/outer_object_with_enum_property.rb -lib/petstore/models/parent_with_nullable.rb lib/petstore/models/pet.rb +lib/petstore/models/property_name_mapping.rb lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb lib/petstore/models/test_inline_freeform_additional_properties_request.rb lib/petstore/models/user.rb +lib/petstore/models/whale.rb +lib/petstore/models/zebra.rb lib/petstore/version.rb petstore.gemspec +spec/models/cow_spec.rb +spec/models/mammal_anyof_spec.rb +spec/models/mammal_spec.rb +spec/models/mammal_without_discriminator_spec.rb +spec/models/one_of_primitive_types_spec.rb +spec/models/property_name_mapping_spec.rb +spec/models/whale_spec.rb +spec/models/zebra_spec.rb spec/spec_helper.rb diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 67ff24e8abb0..ede4e77f7529 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -86,6 +86,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | *Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *Petstore::FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | +*Petstore::FakeApi* | [**get_parameter_name_mapping**](docs/FakeApi.md#get_parameter_name_mapping) | **GET** /fake/parameter-name-mapping | parameter name mapping test *Petstore::FakeApi* | [**test_additional_properties_reference**](docs/FakeApi.md#test_additional_properties_reference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties *Petstore::FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | *Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | @@ -97,7 +98,6 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*Petstore::FakeApi* | [**test_nullable**](docs/FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property *Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | *Petstore::FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -136,9 +136,9 @@ Class | Method | HTTP request | Description - [Petstore::Capitalization](docs/Capitalization.md) - [Petstore::Cat](docs/Cat.md) - [Petstore::Category](docs/Category.md) - - [Petstore::ChildWithNullable](docs/ChildWithNullable.md) - [Petstore::ClassModel](docs/ClassModel.md) - [Petstore::Client](docs/Client.md) + - [Petstore::Cow](docs/Cow.md) - [Petstore::DeprecatedObject](docs/DeprecatedObject.md) - [Petstore::Dog](docs/Dog.md) - [Petstore::EnumArrays](docs/EnumArrays.md) @@ -153,6 +153,9 @@ Class | Method | HTTP request | Description - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) - [Petstore::List](docs/List.md) + - [Petstore::Mammal](docs/Mammal.md) + - [Petstore::MammalAnyof](docs/MammalAnyof.md) + - [Petstore::MammalWithoutDiscriminator](docs/MammalWithoutDiscriminator.md) - [Petstore::MapTest](docs/MapTest.md) - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Petstore::Model200Response](docs/Model200Response.md) @@ -161,6 +164,7 @@ Class | Method | HTTP request | Description - [Petstore::NullableClass](docs/NullableClass.md) - [Petstore::NumberOnly](docs/NumberOnly.md) - [Petstore::ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) + - [Petstore::OneOfPrimitiveTypes](docs/OneOfPrimitiveTypes.md) - [Petstore::Order](docs/Order.md) - [Petstore::OuterComposite](docs/OuterComposite.md) - [Petstore::OuterEnum](docs/OuterEnum.md) @@ -168,14 +172,16 @@ Class | Method | HTTP request | Description - [Petstore::OuterEnumInteger](docs/OuterEnumInteger.md) - [Petstore::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Petstore::OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md) - - [Petstore::ParentWithNullable](docs/ParentWithNullable.md) - [Petstore::Pet](docs/Pet.md) + - [Petstore::PropertyNameMapping](docs/PropertyNameMapping.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SingleRefType](docs/SingleRefType.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - [Petstore::TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - [Petstore::User](docs/User.md) + - [Petstore::Whale](docs/Whale.md) + - [Petstore::Zebra](docs/Zebra.md) ## Documentation for Authorization diff --git a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md index 52f3f5a72e9b..958074809225 100644 --- a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/DefaultApi.md b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md index 86925bb7c887..cffdce1f8060 100644 --- a/samples/client/petstore/ruby-faraday/docs/DefaultApi.md +++ b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index 4262104d12af..ad4bb256e339 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | @@ -12,6 +12,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | | | [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | | | [**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | | +| [**get_parameter_name_mapping**](FakeApi.md#get_parameter_name_mapping) | **GET** /fake/parameter-name-mapping | parameter name mapping test | | [**test_additional_properties_reference**](FakeApi.md#test_additional_properties_reference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | | [**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | | | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | | @@ -23,7 +24,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | | [**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | | [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data | -| [**test_nullable**](FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property | | [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | | | [**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map | @@ -546,6 +546,73 @@ No authorization required - **Accept**: */* +## get_parameter_name_mapping + +> get_parameter_name_mapping(_type, type, type_, http_debug_option) + +parameter name mapping test + +### Examples + +```ruby +require 'time' +require 'petstore' + +api_instance = Petstore::FakeApi.new +_type = 789 # Integer | _type +type = 'type_example' # String | type +type_ = 'type__example' # String | type_ +http_debug_option = 'http_debug_option_example' # String | http debug option (to test parameter naming option) + +begin + # parameter name mapping test + api_instance.get_parameter_name_mapping(_type, type, type_, http_debug_option) +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->get_parameter_name_mapping: #{e}" +end +``` + +#### Using the get_parameter_name_mapping_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> get_parameter_name_mapping_with_http_info(_type, type, type_, http_debug_option) + +```ruby +begin + # parameter name mapping test + data, status_code, headers = api_instance.get_parameter_name_mapping_with_http_info(_type, type, type_, http_debug_option) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Petstore::ApiError => e + puts "Error when calling FakeApi->get_parameter_name_mapping_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_type** | **Integer** | _type | | +| **type** | **String** | type | | +| **type_** | **String** | type_ | | +| **http_debug_option** | **String** | http debug option (to test parameter naming option) | | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + ## test_additional_properties_reference > test_additional_properties_reference(request_body) @@ -1311,69 +1378,6 @@ No authorization required - **Accept**: Not defined -## test_nullable - -> test_nullable(child_with_nullable) - -test nullable parent property - - - -### Examples - -```ruby -require 'time' -require 'petstore' - -api_instance = Petstore::FakeApi.new -child_with_nullable = Petstore::ChildWithNullable.new # ChildWithNullable | request body - -begin - # test nullable parent property - api_instance.test_nullable(child_with_nullable) -rescue Petstore::ApiError => e - puts "Error when calling FakeApi->test_nullable: #{e}" -end -``` - -#### Using the test_nullable_with_http_info variant - -This returns an Array which contains the response data (`nil` in this case), status code and headers. - -> test_nullable_with_http_info(child_with_nullable) - -```ruby -begin - # test nullable parent property - data, status_code, headers = api_instance.test_nullable_with_http_info(child_with_nullable) - p status_code # => 2xx - p headers # => { ... } - p data # => nil -rescue Petstore::ApiError => e - puts "Error when calling FakeApi->test_nullable_with_http_info: #{e}" -end -``` - -### Parameters - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **child_with_nullable** | [**ChildWithNullable**](ChildWithNullable.md) | request body | | - -### Return type - -nil (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - - ## test_query_parameter_collection_format > test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) diff --git a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md index 32d3ff8ebdd2..770127d28bd7 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/PetApi.md b/samples/client/petstore/ruby-faraday/docs/PetApi.md index b28334ae2c58..3e1586aab72e 100644 --- a/samples/client/petstore/ruby-faraday/docs/PetApi.md +++ b/samples/client/petstore/ruby-faraday/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/client/petstore/ruby-faraday/docs/StoreApi.md index 52c551498cf0..144421ea306d 100644 --- a/samples/client/petstore/ruby-faraday/docs/StoreApi.md +++ b/samples/client/petstore/ruby-faraday/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/UserApi.md b/samples/client/petstore/ruby-faraday/docs/UserApi.md index 348f5f9c4295..e740c84292fa 100644 --- a/samples/client/petstore/ruby-faraday/docs/UserApi.md +++ b/samples/client/petstore/ruby-faraday/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 61ef3c5871d4..9984140c1e41 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -28,6 +28,7 @@ require 'petstore/models/category' require 'petstore/models/class_model' require 'petstore/models/client' +require 'petstore/models/cow' require 'petstore/models/deprecated_object' require 'petstore/models/enum_arrays' require 'petstore/models/enum_class' @@ -41,6 +42,9 @@ require 'petstore/models/has_only_read_only' require 'petstore/models/health_check_result' require 'petstore/models/list' +require 'petstore/models/mammal' +require 'petstore/models/mammal_anyof' +require 'petstore/models/mammal_without_discriminator' require 'petstore/models/map_test' require 'petstore/models/mixed_properties_and_additional_properties_class' require 'petstore/models/model200_response' @@ -49,6 +53,7 @@ require 'petstore/models/nullable_class' require 'petstore/models/number_only' require 'petstore/models/object_with_deprecated_fields' +require 'petstore/models/one_of_primitive_types' require 'petstore/models/order' require 'petstore/models/outer_composite' require 'petstore/models/outer_enum' @@ -56,16 +61,17 @@ require 'petstore/models/outer_enum_integer' require 'petstore/models/outer_enum_integer_default_value' require 'petstore/models/outer_object_with_enum_property' -require 'petstore/models/parent_with_nullable' require 'petstore/models/pet' +require 'petstore/models/property_name_mapping' require 'petstore/models/read_only_first' require 'petstore/models/single_ref_type' require 'petstore/models/special_model_name' require 'petstore/models/tag' require 'petstore/models/test_inline_freeform_additional_properties_request' require 'petstore/models/user' +require 'petstore/models/whale' +require 'petstore/models/zebra' require 'petstore/models/cat' -require 'petstore/models/child_with_nullable' require 'petstore/models/dog' # APIs diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index bb3e258fdaa3..db8c586cd65b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -513,6 +513,87 @@ def fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_p return data, status_code, headers end + # parameter name mapping test + # @param _type [Integer] _type + # @param type [String] type + # @param type_ [String] type_ + # @param http_debug_option [String] http debug option (to test parameter naming option) + # @param [Hash] opts the optional parameters + # @return [nil] + def get_parameter_name_mapping(_type, type, type_, http_debug_option, opts = {}) + get_parameter_name_mapping_with_http_info(_type, type, type_, http_debug_option, opts) + nil + end + + # parameter name mapping test + # @param _type [Integer] _type + # @param type [String] type + # @param type_ [String] type_ + # @param http_debug_option [String] http debug option (to test parameter naming option) + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def get_parameter_name_mapping_with_http_info(_type, type, type_, http_debug_option, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.get_parameter_name_mapping ...' + end + # verify the required parameter '_type' is set + if @api_client.config.client_side_validation && _type.nil? + fail ArgumentError, "Missing the required parameter '_type' when calling FakeApi.get_parameter_name_mapping" + end + # verify the required parameter 'type' is set + if @api_client.config.client_side_validation && type.nil? + fail ArgumentError, "Missing the required parameter 'type' when calling FakeApi.get_parameter_name_mapping" + end + # verify the required parameter 'type_' is set + if @api_client.config.client_side_validation && type_.nil? + fail ArgumentError, "Missing the required parameter 'type_' when calling FakeApi.get_parameter_name_mapping" + end + # verify the required parameter 'http_debug_option' is set + if @api_client.config.client_side_validation && http_debug_option.nil? + fail ArgumentError, "Missing the required parameter 'http_debug_option' when calling FakeApi.get_parameter_name_mapping" + end + # resource path + local_var_path = '/fake/parameter-name-mapping' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'type'] = type + query_params[:'http_debug_option'] = http_debug_option + + # header parameters + header_params = opts[:header_params] || {} + header_params['_type'] = _type + header_params['type_'] = type_ + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"FakeApi.get_parameter_name_mapping", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#get_parameter_name_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # test referenced additionalProperties # # @param request_body [Hash] request body @@ -1426,72 +1507,6 @@ def test_json_form_data_with_http_info(param, param2, opts = {}) return data, status_code, headers end - # test nullable parent property - # - # @param child_with_nullable [ChildWithNullable] request body - # @param [Hash] opts the optional parameters - # @return [nil] - def test_nullable(child_with_nullable, opts = {}) - test_nullable_with_http_info(child_with_nullable, opts) - nil - end - - # test nullable parent property - # - # @param child_with_nullable [ChildWithNullable] request body - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_nullable_with_http_info(child_with_nullable, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FakeApi.test_nullable ...' - end - # verify the required parameter 'child_with_nullable' is set - if @api_client.config.client_side_validation && child_with_nullable.nil? - fail ArgumentError, "Missing the required parameter 'child_with_nullable' when calling FakeApi.test_nullable" - end - # resource path - local_var_path = '/fake/nullable' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(child_with_nullable) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || [] - - new_options = opts.merge( - :operation => :"FakeApi.test_nullable", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: FakeApi#test_nullable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # To test the collection format in query parameters # @param pipe [Array] # @param ioutil [Array] diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 96ef62dbb392..d7314a93d370 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -157,7 +157,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'petstore.swagger.io' + @host = 'localhost' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -290,6 +290,10 @@ def auth_settings # Returns an array of Server setting def server_settings [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://{server}.swagger.io:{port}/v2", description: "petstore server", @@ -330,6 +334,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 @@ -337,6 +355,61 @@ def server_settings def operation_server_settings { "PetApi.add_pet": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, + { + 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.delete_pet": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -367,9 +440,78 @@ 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.get_pet_by_id": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, + { + 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": [ + { + url: "http://localhost/v2", + description: "No description provided", + }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -400,6 +542,71 @@ 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://localhost/v2", + description: "No description provided", + }, + { + 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" + ] + } + } } ], } From 324d773123c0253be9d2acf9ddff39fac8f2c112 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 16:56:52 +0800 Subject: [PATCH 07/17] update tests --- .../petstore/ruby/spec/custom/configuration_spec.rb | 12 ++++++------ samples/client/petstore/ruby/spec/custom/pet_spec.rb | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb index 36e3d851548f..7dce888f0e97 100644 --- a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb @@ -27,31 +27,31 @@ describe '#base_url' do it 'should have the default value' do - expect(config.base_url).to eq("http://petstore.swagger.io/v2") + expect(config.base_url).to eq("http://localhost/v2") end it 'returns default value when invalid operation is passed' do - expect(config.base_url('invalid_operation')).to eq('http://petstore.swagger.io/v2') + expect(config.base_url('invalid_operation')).to eq('http://localhost/v2') end it 'returns proper URL default server_index' do - expect(config.base_url(:'PetApi.add_pet')).to eq('http://petstore.swagger.io/v2') + expect(config.base_url(:'PetApi.add_pet')).to eq('http://localhost/v2') end it 'returns proper URL when server_index is set' do - config.server_index = 1 + config.server_index = 2 expect(config.base_url(:'PetApi.add_pet')).to eq('http://path-server-test.petstore.local/v2') end it 'returns proper URL when server_operation_index is set' do config.server_operation_index = { - :'PetApi.add_pet' => 1 + :'PetApi.add_pet' =>2 } expect(config.base_url(:'PetApi.add_pet')).to eq('http://path-server-test.petstore.local/v2') end it 'returns proper URL from server_settings when server_index is set' do - config.server_index = 1 + config.server_index = 2 expect(config.base_url).to eq('https://localhost:8080/v2') end diff --git a/samples/client/petstore/ruby/spec/custom/pet_spec.rb b/samples/client/petstore/ruby/spec/custom/pet_spec.rb index ae2285d74257..a816d78e4dd2 100644 --- a/samples/client/petstore/ruby/spec/custom/pet_spec.rb +++ b/samples/client/petstore/ruby/spec/custom/pet_spec.rb @@ -66,7 +66,7 @@ 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 + :'PetApi.get_pet_by_id' => 2 } expect(@pet_api.api_client.config.base_url(:'PetApi.get_pet_by_id')).to eq('http://path-server-test.petstore.local/v2') @@ -86,7 +86,7 @@ expect(index_backup).to eq({}) # test operation index 3 @pet_api.api_client.config.server_operation_index = { - :'PetApi.get_pet_by_id' => 3 + :'PetApi.get_pet_by_id' => 4 } expect(@pet_api.api_client.config.base_url(:'PetApi.get_pet_by_id')).to eq('http://path.v2.test.openapi-generator.tech/v2') From ef0aef28d75a12f4d41a6f954138b99edec4e220 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 17:02:14 +0800 Subject: [PATCH 08/17] use 127.0.0.1 --- ...ore-with-fake-endpoints-models-for-testing.yaml | 6 +++--- .../petstore/ruby-faraday/.openapi-generator/FILES | 8 -------- samples/client/petstore/ruby-faraday/README.md | 2 +- .../petstore/ruby-faraday/docs/AnotherFakeApi.md | 2 +- .../petstore/ruby-faraday/docs/DefaultApi.md | 2 +- .../client/petstore/ruby-faraday/docs/FakeApi.md | 2 +- .../ruby-faraday/docs/FakeClassnameTags123Api.md | 2 +- .../client/petstore/ruby-faraday/docs/PetApi.md | 2 +- .../client/petstore/ruby-faraday/docs/StoreApi.md | 2 +- .../client/petstore/ruby-faraday/docs/UserApi.md | 2 +- .../ruby-faraday/lib/petstore/configuration.rb | 14 +++++++------- samples/client/petstore/ruby-httpx/README.md | 2 +- .../petstore/ruby-httpx/docs/AnotherFakeApi.md | 2 +- .../client/petstore/ruby-httpx/docs/DefaultApi.md | 2 +- samples/client/petstore/ruby-httpx/docs/FakeApi.md | 2 +- .../ruby-httpx/docs/FakeClassnameTags123Api.md | 2 +- samples/client/petstore/ruby-httpx/docs/PetApi.md | 2 +- .../client/petstore/ruby-httpx/docs/StoreApi.md | 2 +- samples/client/petstore/ruby-httpx/docs/UserApi.md | 2 +- .../ruby-httpx/lib/petstore/configuration.rb | 14 +++++++------- samples/client/petstore/ruby/README.md | 2 +- .../client/petstore/ruby/docs/AnotherFakeApi.md | 2 +- samples/client/petstore/ruby/docs/DefaultApi.md | 2 +- samples/client/petstore/ruby/docs/FakeApi.md | 2 +- .../petstore/ruby/docs/FakeClassnameTags123Api.md | 2 +- samples/client/petstore/ruby/docs/PetApi.md | 2 +- samples/client/petstore/ruby/docs/StoreApi.md | 2 +- samples/client/petstore/ruby/docs/UserApi.md | 2 +- .../petstore/ruby/lib/petstore/configuration.rb | 14 +++++++------- .../ruby/spec/custom/configuration_spec.rb | 4 ++-- 30 files changed, 50 insertions(+), 58 deletions(-) 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 5bddaf3cfcea..48bce1c4cc35 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 @@ -31,7 +31,7 @@ paths: $ref: '#/components/schemas/Foo' /pet: servers: - - url: 'http://localhost/v2' + - url: 'http://127.0.0.1/v2' - url: 'http://petstore.swagger.io/v2' - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' @@ -189,7 +189,7 @@ paths: deprecated: true '/pet/{petId}': servers: - - url: 'http://localhost/v2' + - url: 'http://127.0.0.1/v2' - url: 'http://petstore.swagger.io/v2' - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' @@ -1360,7 +1360,7 @@ paths: 200: description: OK servers: - - url: 'http://localhost/v2' + - url: 'http://127.0.0.1/v2' - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server variables: diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index 4159374bb74d..fa488c13b2d9 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -139,12 +139,4 @@ lib/petstore/models/whale.rb lib/petstore/models/zebra.rb lib/petstore/version.rb petstore.gemspec -spec/models/cow_spec.rb -spec/models/mammal_anyof_spec.rb -spec/models/mammal_spec.rb -spec/models/mammal_without_discriminator_spec.rb -spec/models/one_of_primitive_types_spec.rb -spec/models/property_name_mapping_spec.rb -spec/models/whale_spec.rb -spec/models/zebra_spec.rb spec/spec_helper.rb diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index ede4e77f7529..4f5937d0e770 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md index 958074809225..3bd6902268df 100644 --- a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/DefaultApi.md b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md index cffdce1f8060..6fe3bf4db19d 100644 --- a/samples/client/petstore/ruby-faraday/docs/DefaultApi.md +++ b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index ad4bb256e339..171e3d6e8b56 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md index 770127d28bd7..44ec0be720d1 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/PetApi.md b/samples/client/petstore/ruby-faraday/docs/PetApi.md index 3e1586aab72e..ec1a1a763fb5 100644 --- a/samples/client/petstore/ruby-faraday/docs/PetApi.md +++ b/samples/client/petstore/ruby-faraday/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/client/petstore/ruby-faraday/docs/StoreApi.md index 144421ea306d..3c6dad2ecd78 100644 --- a/samples/client/petstore/ruby-faraday/docs/StoreApi.md +++ b/samples/client/petstore/ruby-faraday/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/UserApi.md b/samples/client/petstore/ruby-faraday/docs/UserApi.md index e740c84292fa..4a1d2af0e8bc 100644 --- a/samples/client/petstore/ruby-faraday/docs/UserApi.md +++ b/samples/client/petstore/ruby-faraday/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index d7314a93d370..46752597e371 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -157,7 +157,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'localhost' + @host = '127.0.0.1' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -291,7 +291,7 @@ def auth_settings def server_settings [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -356,7 +356,7 @@ def operation_server_settings { "PetApi.add_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -407,7 +407,7 @@ def operation_server_settings ], "PetApi.delete_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -458,7 +458,7 @@ def operation_server_settings ], "PetApi.get_pet_by_id": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -509,7 +509,7 @@ def operation_server_settings ], "PetApi.update_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -560,7 +560,7 @@ def operation_server_settings ], "PetApi.update_pet_with_form": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { diff --git a/samples/client/petstore/ruby-httpx/README.md b/samples/client/petstore/ruby-httpx/README.md index ede4e77f7529..4f5937d0e770 100644 --- a/samples/client/petstore/ruby-httpx/README.md +++ b/samples/client/petstore/ruby-httpx/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md index 958074809225..3bd6902268df 100644 --- a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md index cffdce1f8060..6fe3bf4db19d 100644 --- a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md +++ b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/FakeApi.md b/samples/client/petstore/ruby-httpx/docs/FakeApi.md index ad4bb256e339..171e3d6e8b56 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md index 770127d28bd7..44ec0be720d1 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/PetApi.md b/samples/client/petstore/ruby-httpx/docs/PetApi.md index 3e1586aab72e..ec1a1a763fb5 100644 --- a/samples/client/petstore/ruby-httpx/docs/PetApi.md +++ b/samples/client/petstore/ruby-httpx/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/StoreApi.md b/samples/client/petstore/ruby-httpx/docs/StoreApi.md index 144421ea306d..3c6dad2ecd78 100644 --- a/samples/client/petstore/ruby-httpx/docs/StoreApi.md +++ b/samples/client/petstore/ruby-httpx/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/UserApi.md b/samples/client/petstore/ruby-httpx/docs/UserApi.md index e740c84292fa..4a1d2af0e8bc 100644 --- a/samples/client/petstore/ruby-httpx/docs/UserApi.md +++ b/samples/client/petstore/ruby-httpx/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb index 20e6e7ab3f23..03825b0cc798 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb @@ -128,7 +128,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'localhost' + @host = '127.0.0.1' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -255,7 +255,7 @@ def auth_settings def server_settings [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -320,7 +320,7 @@ def operation_server_settings { "PetApi.add_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -371,7 +371,7 @@ def operation_server_settings ], "PetApi.delete_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -422,7 +422,7 @@ def operation_server_settings ], "PetApi.get_pet_by_id": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -473,7 +473,7 @@ def operation_server_settings ], "PetApi.update_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -524,7 +524,7 @@ def operation_server_settings ], "PetApi.update_pet_with_form": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index ede4e77f7529..4f5937d0e770 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby/docs/AnotherFakeApi.md b/samples/client/petstore/ruby/docs/AnotherFakeApi.md index 958074809225..3bd6902268df 100644 --- a/samples/client/petstore/ruby/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/DefaultApi.md b/samples/client/petstore/ruby/docs/DefaultApi.md index cffdce1f8060..6fe3bf4db19d 100644 --- a/samples/client/petstore/ruby/docs/DefaultApi.md +++ b/samples/client/petstore/ruby/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index bb4542988bb9..5169a58a1dac 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md index 770127d28bd7..44ec0be720d1 100644 --- a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index 3e1586aab72e..ec1a1a763fb5 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 144421ea306d..3c6dad2ecd78 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index e740c84292fa..4a1d2af0e8bc 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://127.0.0.1/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 519cf11226c8..aa95c605f065 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -158,7 +158,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'localhost' + @host = '127.0.0.1' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -287,7 +287,7 @@ def auth_settings def server_settings [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -352,7 +352,7 @@ def operation_server_settings { "PetApi.add_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -403,7 +403,7 @@ def operation_server_settings ], "PetApi.delete_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -454,7 +454,7 @@ def operation_server_settings ], "PetApi.get_pet_by_id": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -505,7 +505,7 @@ def operation_server_settings ], "PetApi.update_pet": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { @@ -556,7 +556,7 @@ def operation_server_settings ], "PetApi.update_pet_with_form": [ { - url: "http://localhost/v2", + url: "http://127.0.0.1/v2", description: "No description provided", }, { diff --git a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb index 7dce888f0e97..b1af32e8a8cc 100644 --- a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb @@ -66,11 +66,11 @@ it 'throws argument error when attempting to use a server index that is out of bounds' do config.server_operation_index = { - :'PetApi.add_pet' => 10 + :'PetApi.add_pet' => 11 } 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 4') + }.to raise_error(ArgumentError, 'Invalid index 11 when selecting the server. Must not be nil and must be less than 4') end it 'should remove trailing slashes' do From 260787b0a1bd9ac11e64579f621b20e0d12a0598 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 17:07:40 +0800 Subject: [PATCH 09/17] update --- ...e-with-fake-endpoints-models-for-testing.yaml | 8 ++++---- samples/client/petstore/ruby-faraday/README.md | 2 +- .../petstore/ruby-faraday/docs/AnotherFakeApi.md | 2 +- .../petstore/ruby-faraday/docs/DefaultApi.md | 2 +- .../client/petstore/ruby-faraday/docs/FakeApi.md | 2 +- .../ruby-faraday/docs/FakeClassnameTags123Api.md | 2 +- .../client/petstore/ruby-faraday/docs/PetApi.md | 2 +- .../petstore/ruby-faraday/docs/StoreApi.md | 2 +- .../client/petstore/ruby-faraday/docs/UserApi.md | 2 +- .../ruby-faraday/lib/petstore/configuration.rb | 16 ++++++++-------- samples/client/petstore/ruby-httpx/README.md | 2 +- .../petstore/ruby-httpx/docs/AnotherFakeApi.md | 2 +- .../petstore/ruby-httpx/docs/DefaultApi.md | 2 +- .../client/petstore/ruby-httpx/docs/FakeApi.md | 2 +- .../ruby-httpx/docs/FakeClassnameTags123Api.md | 2 +- .../client/petstore/ruby-httpx/docs/PetApi.md | 2 +- .../client/petstore/ruby-httpx/docs/StoreApi.md | 2 +- .../client/petstore/ruby-httpx/docs/UserApi.md | 2 +- .../ruby-httpx/lib/petstore/configuration.rb | 16 ++++++++-------- samples/client/petstore/ruby/README.md | 2 +- .../client/petstore/ruby/docs/AnotherFakeApi.md | 2 +- samples/client/petstore/ruby/docs/DefaultApi.md | 2 +- samples/client/petstore/ruby/docs/FakeApi.md | 2 +- .../ruby/docs/FakeClassnameTags123Api.md | 2 +- samples/client/petstore/ruby/docs/PetApi.md | 2 +- samples/client/petstore/ruby/docs/StoreApi.md | 2 +- samples/client/petstore/ruby/docs/UserApi.md | 2 +- .../petstore/ruby/lib/petstore/configuration.rb | 16 ++++++++-------- 28 files changed, 52 insertions(+), 52 deletions(-) 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 48bce1c4cc35..4c6d21a48ea2 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 @@ -31,7 +31,7 @@ paths: $ref: '#/components/schemas/Foo' /pet: servers: - - url: 'http://127.0.0.1/v2' + - url: 'http://domaincontrol.com/v2' - url: 'http://petstore.swagger.io/v2' - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' @@ -189,7 +189,7 @@ paths: deprecated: true '/pet/{petId}': servers: - - url: 'http://127.0.0.1/v2' + - url: 'http://domaincontrol.com/v2' - url: 'http://petstore.swagger.io/v2' - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' @@ -1360,7 +1360,7 @@ paths: 200: description: OK servers: - - url: 'http://127.0.0.1/v2' + - url: 'http://domaincontrol.com/v2' - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server variables: @@ -1383,7 +1383,7 @@ servers: - 'v1' - 'v2' default: 'v2' - - url: https://127.0.0.1/no_varaible + - url: https://domaincontrol.com/no_varaible description: The local server without variables - url: http://server.{version}.openapi-generator.tech description: The openapi-generator test server diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 4f5937d0e770..98b768a52374 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md index 3bd6902268df..dc77856395a8 100644 --- a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/DefaultApi.md b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md index 6fe3bf4db19d..5864fbcab348 100644 --- a/samples/client/petstore/ruby-faraday/docs/DefaultApi.md +++ b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index 171e3d6e8b56..04c18a8ff00e 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md index 44ec0be720d1..2384b3a2ebe0 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/PetApi.md b/samples/client/petstore/ruby-faraday/docs/PetApi.md index ec1a1a763fb5..a8b924efa123 100644 --- a/samples/client/petstore/ruby-faraday/docs/PetApi.md +++ b/samples/client/petstore/ruby-faraday/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/client/petstore/ruby-faraday/docs/StoreApi.md index 3c6dad2ecd78..9925fd1571a8 100644 --- a/samples/client/petstore/ruby-faraday/docs/StoreApi.md +++ b/samples/client/petstore/ruby-faraday/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/UserApi.md b/samples/client/petstore/ruby-faraday/docs/UserApi.md index 4a1d2af0e8bc..2e6a658c42d7 100644 --- a/samples/client/petstore/ruby-faraday/docs/UserApi.md +++ b/samples/client/petstore/ruby-faraday/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 46752597e371..b2e5797adbf0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -157,7 +157,7 @@ class Configuration def initialize @scheme = 'http' - @host = '127.0.0.1' + @host = 'domaincontrol.com' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -291,7 +291,7 @@ def auth_settings def server_settings [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -332,7 +332,7 @@ def server_settings } }, { - url: "https://127.0.0.1/no_varaible", + url: "https://domaincontrol.com/no_varaible", description: "The local server without variables", }, { @@ -356,7 +356,7 @@ def operation_server_settings { "PetApi.add_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -407,7 +407,7 @@ def operation_server_settings ], "PetApi.delete_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -458,7 +458,7 @@ def operation_server_settings ], "PetApi.get_pet_by_id": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -509,7 +509,7 @@ def operation_server_settings ], "PetApi.update_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -560,7 +560,7 @@ def operation_server_settings ], "PetApi.update_pet_with_form": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { diff --git a/samples/client/petstore/ruby-httpx/README.md b/samples/client/petstore/ruby-httpx/README.md index 4f5937d0e770..98b768a52374 100644 --- a/samples/client/petstore/ruby-httpx/README.md +++ b/samples/client/petstore/ruby-httpx/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md index 3bd6902268df..dc77856395a8 100644 --- a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md index 6fe3bf4db19d..5864fbcab348 100644 --- a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md +++ b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/FakeApi.md b/samples/client/petstore/ruby-httpx/docs/FakeApi.md index 171e3d6e8b56..04c18a8ff00e 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md index 44ec0be720d1..2384b3a2ebe0 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/PetApi.md b/samples/client/petstore/ruby-httpx/docs/PetApi.md index ec1a1a763fb5..a8b924efa123 100644 --- a/samples/client/petstore/ruby-httpx/docs/PetApi.md +++ b/samples/client/petstore/ruby-httpx/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/StoreApi.md b/samples/client/petstore/ruby-httpx/docs/StoreApi.md index 3c6dad2ecd78..9925fd1571a8 100644 --- a/samples/client/petstore/ruby-httpx/docs/StoreApi.md +++ b/samples/client/petstore/ruby-httpx/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/UserApi.md b/samples/client/petstore/ruby-httpx/docs/UserApi.md index 4a1d2af0e8bc..2e6a658c42d7 100644 --- a/samples/client/petstore/ruby-httpx/docs/UserApi.md +++ b/samples/client/petstore/ruby-httpx/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb index 03825b0cc798..11029ea807b4 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb @@ -128,7 +128,7 @@ class Configuration def initialize @scheme = 'http' - @host = '127.0.0.1' + @host = 'domaincontrol.com' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -255,7 +255,7 @@ def auth_settings def server_settings [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -296,7 +296,7 @@ def server_settings } }, { - url: "https://127.0.0.1/no_varaible", + url: "https://domaincontrol.com/no_varaible", description: "The local server without variables", }, { @@ -320,7 +320,7 @@ def operation_server_settings { "PetApi.add_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -371,7 +371,7 @@ def operation_server_settings ], "PetApi.delete_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -422,7 +422,7 @@ def operation_server_settings ], "PetApi.get_pet_by_id": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -473,7 +473,7 @@ def operation_server_settings ], "PetApi.update_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -524,7 +524,7 @@ def operation_server_settings ], "PetApi.update_pet_with_form": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 4f5937d0e770..98b768a52374 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby/docs/AnotherFakeApi.md b/samples/client/petstore/ruby/docs/AnotherFakeApi.md index 3bd6902268df..dc77856395a8 100644 --- a/samples/client/petstore/ruby/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/DefaultApi.md b/samples/client/petstore/ruby/docs/DefaultApi.md index 6fe3bf4db19d..5864fbcab348 100644 --- a/samples/client/petstore/ruby/docs/DefaultApi.md +++ b/samples/client/petstore/ruby/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 5169a58a1dac..22035c9977fc 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md index 44ec0be720d1..2384b3a2ebe0 100644 --- a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index ec1a1a763fb5..a8b924efa123 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 3c6dad2ecd78..9925fd1571a8 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index 4a1d2af0e8bc..2e6a658c42d7 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://127.0.0.1/v2* +All URIs are relative to *http://domaincontrol.com/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index aa95c605f065..91feec4d04a5 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -158,7 +158,7 @@ class Configuration def initialize @scheme = 'http' - @host = '127.0.0.1' + @host = 'domaincontrol.com' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -287,7 +287,7 @@ def auth_settings def server_settings [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -328,7 +328,7 @@ def server_settings } }, { - url: "https://127.0.0.1/no_varaible", + url: "https://domaincontrol.com/no_varaible", description: "The local server without variables", }, { @@ -352,7 +352,7 @@ def operation_server_settings { "PetApi.add_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -403,7 +403,7 @@ def operation_server_settings ], "PetApi.delete_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -454,7 +454,7 @@ def operation_server_settings ], "PetApi.get_pet_by_id": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -505,7 +505,7 @@ def operation_server_settings ], "PetApi.update_pet": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { @@ -556,7 +556,7 @@ def operation_server_settings ], "PetApi.update_pet_with_form": [ { - url: "http://127.0.0.1/v2", + url: "http://domaincontrol.com/v2", description: "No description provided", }, { From 117773f14c629d8d31053163aa33e55086c8a4f0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 17:29:03 +0800 Subject: [PATCH 10/17] update samples --- ...ith-fake-endpoints-models-for-testing.yaml | 5 +--- .../client/petstore/ruby-faraday/README.md | 2 +- .../ruby-faraday/docs/AnotherFakeApi.md | 2 +- .../petstore/ruby-faraday/docs/DefaultApi.md | 2 +- .../petstore/ruby-faraday/docs/FakeApi.md | 2 +- .../docs/FakeClassnameTags123Api.md | 2 +- .../petstore/ruby-faraday/docs/PetApi.md | 2 +- .../petstore/ruby-faraday/docs/StoreApi.md | 2 +- .../petstore/ruby-faraday/docs/UserApi.md | 2 +- .../lib/petstore/configuration.rb | 28 ++----------------- samples/client/petstore/ruby-httpx/README.md | 2 +- .../ruby-httpx/docs/AnotherFakeApi.md | 2 +- .../petstore/ruby-httpx/docs/DefaultApi.md | 2 +- .../petstore/ruby-httpx/docs/FakeApi.md | 2 +- .../docs/FakeClassnameTags123Api.md | 2 +- .../client/petstore/ruby-httpx/docs/PetApi.md | 2 +- .../petstore/ruby-httpx/docs/StoreApi.md | 2 +- .../petstore/ruby-httpx/docs/UserApi.md | 2 +- .../ruby-httpx/lib/petstore/configuration.rb | 28 ++----------------- samples/client/petstore/ruby/README.md | 2 +- .../petstore/ruby/docs/AnotherFakeApi.md | 2 +- .../client/petstore/ruby/docs/DefaultApi.md | 2 +- samples/client/petstore/ruby/docs/FakeApi.md | 2 +- .../ruby/docs/FakeClassnameTags123Api.md | 2 +- samples/client/petstore/ruby/docs/PetApi.md | 2 +- samples/client/petstore/ruby/docs/StoreApi.md | 2 +- samples/client/petstore/ruby/docs/UserApi.md | 2 +- .../ruby/lib/petstore/configuration.rb | 28 ++----------------- .../ruby/spec/custom/configuration_spec.rb | 16 +++++------ .../petstore/ruby/spec/custom/pet_spec.rb | 4 +-- 30 files changed, 41 insertions(+), 116 deletions(-) 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 4c6d21a48ea2..064862059da5 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 @@ -31,7 +31,6 @@ paths: $ref: '#/components/schemas/Foo' /pet: servers: - - url: 'http://domaincontrol.com/v2' - url: 'http://petstore.swagger.io/v2' - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' @@ -189,7 +188,6 @@ paths: deprecated: true '/pet/{petId}': servers: - - url: 'http://domaincontrol.com/v2' - url: 'http://petstore.swagger.io/v2' - url: 'http://path-server-test.petstore.local/v2' - url: 'http://{server}.swagger.io:{port}/v2' @@ -1360,7 +1358,6 @@ paths: 200: description: OK servers: - - url: 'http://domaincontrol.com/v2' - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server variables: @@ -1383,7 +1380,7 @@ servers: - 'v1' - 'v2' default: 'v2' - - url: https://domaincontrol.com/no_varaible + - 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 diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 98b768a52374..587ccdfcb967 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md index dc77856395a8..52f3f5a72e9b 100644 --- a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/DefaultApi.md b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md index 5864fbcab348..86925bb7c887 100644 --- a/samples/client/petstore/ruby-faraday/docs/DefaultApi.md +++ b/samples/client/petstore/ruby-faraday/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index 04c18a8ff00e..1e05788c53ab 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md index 2384b3a2ebe0..32d3ff8ebdd2 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/PetApi.md b/samples/client/petstore/ruby-faraday/docs/PetApi.md index a8b924efa123..b28334ae2c58 100644 --- a/samples/client/petstore/ruby-faraday/docs/PetApi.md +++ b/samples/client/petstore/ruby-faraday/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/client/petstore/ruby-faraday/docs/StoreApi.md index 9925fd1571a8..52c551498cf0 100644 --- a/samples/client/petstore/ruby-faraday/docs/StoreApi.md +++ b/samples/client/petstore/ruby-faraday/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/docs/UserApi.md b/samples/client/petstore/ruby-faraday/docs/UserApi.md index 2e6a658c42d7..348f5f9c4295 100644 --- a/samples/client/petstore/ruby-faraday/docs/UserApi.md +++ b/samples/client/petstore/ruby-faraday/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index b2e5797adbf0..945cd4367091 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -157,7 +157,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'domaincontrol.com' + @host = 'petstore.swagger.io' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -290,10 +290,6 @@ def auth_settings # Returns an array of Server setting def server_settings [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://{server}.swagger.io:{port}/v2", description: "petstore server", @@ -332,7 +328,7 @@ def server_settings } }, { - url: "https://domaincontrol.com/no_varaible", + url: "https://127.0.0.1/no_varaible", description: "The local server without variables", }, { @@ -355,10 +351,6 @@ def server_settings def operation_server_settings { "PetApi.add_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -406,10 +398,6 @@ def operation_server_settings } ], "PetApi.delete_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -457,10 +445,6 @@ def operation_server_settings } ], "PetApi.get_pet_by_id": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -508,10 +492,6 @@ def operation_server_settings } ], "PetApi.update_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -559,10 +539,6 @@ def operation_server_settings } ], "PetApi.update_pet_with_form": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", diff --git a/samples/client/petstore/ruby-httpx/README.md b/samples/client/petstore/ruby-httpx/README.md index 98b768a52374..587ccdfcb967 100644 --- a/samples/client/petstore/ruby-httpx/README.md +++ b/samples/client/petstore/ruby-httpx/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md index dc77856395a8..52f3f5a72e9b 100644 --- a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md index 5864fbcab348..86925bb7c887 100644 --- a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md +++ b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/FakeApi.md b/samples/client/petstore/ruby-httpx/docs/FakeApi.md index 04c18a8ff00e..1e05788c53ab 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeApi.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md index 2384b3a2ebe0..32d3ff8ebdd2 100644 --- a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/PetApi.md b/samples/client/petstore/ruby-httpx/docs/PetApi.md index a8b924efa123..b28334ae2c58 100644 --- a/samples/client/petstore/ruby-httpx/docs/PetApi.md +++ b/samples/client/petstore/ruby-httpx/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/StoreApi.md b/samples/client/petstore/ruby-httpx/docs/StoreApi.md index 9925fd1571a8..52c551498cf0 100644 --- a/samples/client/petstore/ruby-httpx/docs/StoreApi.md +++ b/samples/client/petstore/ruby-httpx/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/docs/UserApi.md b/samples/client/petstore/ruby-httpx/docs/UserApi.md index 2e6a658c42d7..348f5f9c4295 100644 --- a/samples/client/petstore/ruby-httpx/docs/UserApi.md +++ b/samples/client/petstore/ruby-httpx/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb index 11029ea807b4..caa1be28dee5 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb @@ -128,7 +128,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'domaincontrol.com' + @host = 'petstore.swagger.io' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -254,10 +254,6 @@ def auth_settings # Returns an array of Server setting def server_settings [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://{server}.swagger.io:{port}/v2", description: "petstore server", @@ -296,7 +292,7 @@ def server_settings } }, { - url: "https://domaincontrol.com/no_varaible", + url: "https://127.0.0.1/no_varaible", description: "The local server without variables", }, { @@ -319,10 +315,6 @@ def server_settings def operation_server_settings { "PetApi.add_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -370,10 +362,6 @@ def operation_server_settings } ], "PetApi.delete_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -421,10 +409,6 @@ def operation_server_settings } ], "PetApi.get_pet_by_id": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -472,10 +456,6 @@ def operation_server_settings } ], "PetApi.update_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -523,10 +503,6 @@ def operation_server_settings } ], "PetApi.update_pet_with_form": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 98b768a52374..587ccdfcb967 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -72,7 +72,7 @@ end ## Documentation for API Endpoints -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/ruby/docs/AnotherFakeApi.md b/samples/client/petstore/ruby/docs/AnotherFakeApi.md index dc77856395a8..52f3f5a72e9b 100644 --- a/samples/client/petstore/ruby/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Petstore::AnotherFakeApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/DefaultApi.md b/samples/client/petstore/ruby/docs/DefaultApi.md index 5864fbcab348..86925bb7c887 100644 --- a/samples/client/petstore/ruby/docs/DefaultApi.md +++ b/samples/client/petstore/ruby/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Petstore::DefaultApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 22035c9977fc..1dff682f9a2d 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -1,6 +1,6 @@ # Petstore::FakeApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md index 2384b3a2ebe0..32d3ff8ebdd2 100644 --- a/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Petstore::FakeClassnameTags123Api -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/PetApi.md b/samples/client/petstore/ruby/docs/PetApi.md index a8b924efa123..b28334ae2c58 100644 --- a/samples/client/petstore/ruby/docs/PetApi.md +++ b/samples/client/petstore/ruby/docs/PetApi.md @@ -1,6 +1,6 @@ # Petstore::PetApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/StoreApi.md b/samples/client/petstore/ruby/docs/StoreApi.md index 9925fd1571a8..52c551498cf0 100644 --- a/samples/client/petstore/ruby/docs/StoreApi.md +++ b/samples/client/petstore/ruby/docs/StoreApi.md @@ -1,6 +1,6 @@ # Petstore::StoreApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md index 2e6a658c42d7..348f5f9c4295 100644 --- a/samples/client/petstore/ruby/docs/UserApi.md +++ b/samples/client/petstore/ruby/docs/UserApi.md @@ -1,6 +1,6 @@ # Petstore::UserApi -All URIs are relative to *http://domaincontrol.com/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | | ------ | ------------ | ----------- | diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 91feec4d04a5..0756a9271761 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -158,7 +158,7 @@ class Configuration def initialize @scheme = 'http' - @host = 'domaincontrol.com' + @host = 'petstore.swagger.io' @base_path = '/v2' @server_index = nil @server_operation_index = {} @@ -286,10 +286,6 @@ def auth_settings # Returns an array of Server setting def server_settings [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://{server}.swagger.io:{port}/v2", description: "petstore server", @@ -328,7 +324,7 @@ def server_settings } }, { - url: "https://domaincontrol.com/no_varaible", + url: "https://127.0.0.1/no_varaible", description: "The local server without variables", }, { @@ -351,10 +347,6 @@ def server_settings def operation_server_settings { "PetApi.add_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -402,10 +394,6 @@ def operation_server_settings } ], "PetApi.delete_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -453,10 +441,6 @@ def operation_server_settings } ], "PetApi.get_pet_by_id": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -504,10 +488,6 @@ def operation_server_settings } ], "PetApi.update_pet": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", @@ -555,10 +535,6 @@ def operation_server_settings } ], "PetApi.update_pet_with_form": [ - { - url: "http://domaincontrol.com/v2", - description: "No description provided", - }, { url: "http://petstore.swagger.io/v2", description: "No description provided", diff --git a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb index b1af32e8a8cc..36e3d851548f 100644 --- a/samples/client/petstore/ruby/spec/custom/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/custom/configuration_spec.rb @@ -27,31 +27,31 @@ describe '#base_url' do it 'should have the default value' do - expect(config.base_url).to eq("http://localhost/v2") + expect(config.base_url).to eq("http://petstore.swagger.io/v2") end it 'returns default value when invalid operation is passed' do - expect(config.base_url('invalid_operation')).to eq('http://localhost/v2') + expect(config.base_url('invalid_operation')).to eq('http://petstore.swagger.io/v2') end it 'returns proper URL default server_index' do - expect(config.base_url(:'PetApi.add_pet')).to eq('http://localhost/v2') + expect(config.base_url(:'PetApi.add_pet')).to eq('http://petstore.swagger.io/v2') end it 'returns proper URL when server_index is set' do - config.server_index = 2 + config.server_index = 1 expect(config.base_url(:'PetApi.add_pet')).to eq('http://path-server-test.petstore.local/v2') end it 'returns proper URL when server_operation_index is set' do config.server_operation_index = { - :'PetApi.add_pet' =>2 + :'PetApi.add_pet' => 1 } expect(config.base_url(:'PetApi.add_pet')).to eq('http://path-server-test.petstore.local/v2') end it 'returns proper URL from server_settings when server_index is set' do - config.server_index = 2 + config.server_index = 1 expect(config.base_url).to eq('https://localhost:8080/v2') end @@ -66,11 +66,11 @@ it 'throws argument error when attempting to use a server index that is out of bounds' do config.server_operation_index = { - :'PetApi.add_pet' => 11 + :'PetApi.add_pet' => 10 } expect { config.base_url(:'PetApi.add_pet') - }.to raise_error(ArgumentError, 'Invalid index 11 when selecting the server. Must not be nil and must be less than 4') + }.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 a816d78e4dd2..ae2285d74257 100644 --- a/samples/client/petstore/ruby/spec/custom/pet_spec.rb +++ b/samples/client/petstore/ruby/spec/custom/pet_spec.rb @@ -66,7 +66,7 @@ expect(index_backup).to eq({}) # test operation index 1 (invalid path) @pet_api.api_client.config.server_operation_index = { - :'PetApi.get_pet_by_id' => 2 + :'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') @@ -86,7 +86,7 @@ expect(index_backup).to eq({}) # test operation index 3 @pet_api.api_client.config.server_operation_index = { - :'PetApi.get_pet_by_id' => 4 + :'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') From 564f4e023dd6fcfef145cfd8be7414bb0272e966 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 17:34:07 +0800 Subject: [PATCH 11/17] cat hosts --- .github/workflows/samples-ruby.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/samples-ruby.yaml b/.github/workflows/samples-ruby.yaml index 383a3ac52cb6..45d680c7bd43 100644 --- a/.github/workflows/samples-ruby.yaml +++ b/.github/workflows/samples-ruby.yaml @@ -23,9 +23,9 @@ jobs: matrix: sample: - samples/client/petstore/ruby/ - - samples/client/petstore/ruby-faraday/ - - samples/client/petstore/ruby-httpx/ - - samples/client/petstore/ruby-autoload/ + #- samples/client/petstore/ruby-faraday/ + #- samples/client/petstore/ruby-httpx/ + #- samples/client/petstore/ruby-autoload/ services: petstore-api: image: swaggerapi/petstore @@ -39,6 +39,7 @@ jobs: - name: Add hosts to /etc/hosts run: | sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts + cat /etc/hosts - uses: ruby/setup-ruby@v1 with: ruby-version: '3.2' # Not needed with a .ruby-version, .tool-versions or mise.toml From 43c78856f5c5ba7b0786669c51ad96483e373f2f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Sep 2025 17:51:01 +0800 Subject: [PATCH 12/17] add new files --- .../client/petstore/ruby-faraday/docs/Cow.md | 15 + .../petstore/ruby-faraday/docs/Mammal.md | 63 ++++ .../petstore/ruby-faraday/docs/MammalAnyof.md | 24 ++ .../docs/MammalWithoutDiscriminator.md | 49 +++ .../ruby-faraday/docs/OneOfPrimitiveTypes.md | 69 +++++ .../ruby-faraday/docs/PropertyNameMapping.md | 24 ++ .../petstore/ruby-faraday/docs/Whale.md | 22 ++ .../petstore/ruby-faraday/docs/Zebra.md | 20 ++ .../ruby-faraday/lib/petstore/models/cow.rb | 40 +++ .../lib/petstore/models/mammal.rb | 43 +++ .../lib/petstore/models/mammal_anyof.rb | 103 +++++++ .../models/mammal_without_discriminator.rb | 104 +++++++ .../petstore/models/one_of_primitive_types.rb | 114 +++++++ .../petstore/models/property_name_mapping.rb | 247 +++++++++++++++ .../ruby-faraday/lib/petstore/models/whale.rb | 255 ++++++++++++++++ .../ruby-faraday/lib/petstore/models/zebra.rb | 280 ++++++++++++++++++ .../ruby-faraday/spec/models/cow_spec.rb | 30 ++ .../spec/models/mammal_anyof_spec.rb | 21 ++ .../ruby-faraday/spec/models/mammal_spec.rb | 38 +++ .../mammal_without_discriminator_spec.rb | 32 ++ .../models/one_of_primitive_types_spec.rb | 32 ++ .../spec/models/property_name_mapping_spec.rb | 54 ++++ .../ruby-faraday/spec/models/whale_spec.rb | 48 +++ .../ruby-faraday/spec/models/zebra_spec.rb | 46 +++ 24 files changed, 1773 insertions(+) create mode 100644 samples/client/petstore/ruby-faraday/docs/Cow.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Mammal.md create mode 100644 samples/client/petstore/ruby-faraday/docs/MammalAnyof.md create mode 100644 samples/client/petstore/ruby-faraday/docs/MammalWithoutDiscriminator.md create mode 100644 samples/client/petstore/ruby-faraday/docs/OneOfPrimitiveTypes.md create mode 100644 samples/client/petstore/ruby-faraday/docs/PropertyNameMapping.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Whale.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Zebra.md create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/cow.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/mammal.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/mammal_anyof.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/mammal_without_discriminator.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/one_of_primitive_types.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/property_name_mapping.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/whale.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/zebra.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/cow_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/mammal_anyof_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/mammal_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/mammal_without_discriminator_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/one_of_primitive_types_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/property_name_mapping_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/whale_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/zebra_spec.rb diff --git a/samples/client/petstore/ruby-faraday/docs/Cow.md b/samples/client/petstore/ruby-faraday/docs/Cow.md new file mode 100644 index 000000000000..6fa7084b8a40 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Cow.md @@ -0,0 +1,15 @@ +# Petstore::Cow + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::Cow.new() +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Mammal.md b/samples/client/petstore/ruby-faraday/docs/Mammal.md new file mode 100644 index 000000000000..399834f63d30 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Mammal.md @@ -0,0 +1,63 @@ +# Petstore::Mammal + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'petstore' + +Petstore::Mammal.openapi_one_of +# => +# [ +# :'Whale', +# :'Zebra' +# ] +``` + +### `openapi_discriminator_name` + +Returns the discriminator's property name. + +#### Example + +```ruby +require 'petstore' + +Petstore::Mammal.openapi_discriminator_name +# => :'classname' +``` +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'petstore' + +Petstore::Mammal.build(data) +# => # + +Petstore::Mammal.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Whale` +- `Zebra` +- `nil` (if no type matches) + diff --git a/samples/client/petstore/ruby-faraday/docs/MammalAnyof.md b/samples/client/petstore/ruby-faraday/docs/MammalAnyof.md new file mode 100644 index 000000000000..bd21a482f1a6 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/MammalAnyof.md @@ -0,0 +1,24 @@ +# Petstore::MammalAnyof + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **has_baleen** | **Boolean** | | [optional] | +| **has_teeth** | **Boolean** | | [optional] | +| **classname** | **String** | | | +| **type** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::MammalAnyof.new( + has_baleen: null, + has_teeth: null, + classname: null, + type: null +) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/MammalWithoutDiscriminator.md b/samples/client/petstore/ruby-faraday/docs/MammalWithoutDiscriminator.md new file mode 100644 index 000000000000..d68495030449 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/MammalWithoutDiscriminator.md @@ -0,0 +1,49 @@ +# Petstore::MammalWithoutDiscriminator + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'petstore' + +Petstore::MammalWithoutDiscriminator.openapi_one_of +# => +# [ +# :'Whale', +# :'Zebra' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'petstore' + +Petstore::MammalWithoutDiscriminator.build(data) +# => # + +Petstore::MammalWithoutDiscriminator.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Whale` +- `Zebra` +- `nil` (if no type matches) + diff --git a/samples/client/petstore/ruby-faraday/docs/OneOfPrimitiveTypes.md b/samples/client/petstore/ruby-faraday/docs/OneOfPrimitiveTypes.md new file mode 100644 index 000000000000..9023811f8f1c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/OneOfPrimitiveTypes.md @@ -0,0 +1,69 @@ +# Petstore::OneOfPrimitiveTypes + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'petstore' + +Petstore::OneOfPrimitiveTypes.openapi_one_of +# => +# [ +# :'Array', +# :'Array', +# :'Array', +# :'Array', +# :'Array', +# :'Array