Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/samples-ruby-client-echo-api.yaml
Original file line number Diff line number Diff line change
@@ -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
47 changes: 28 additions & 19 deletions .github/workflows/samples-ruby.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -20,21 +22,28 @@ 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/
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: 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
#- 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.0
bundler-cache: true
ruby-version: '3.4' # Not needed with a .ruby-version, .tool-versions or mise.toml
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install bundle
working-directory: ${{ matrix.sample }}
run: bundle install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ paths:
$ref: '#/components/schemas/Foo'
/pet:
servers:
- 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'
Expand Down Expand Up @@ -188,6 +189,7 @@ paths:
deprecated: true
'/pet/{petId}':
servers:
- 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'
Expand Down Expand Up @@ -1358,6 +1360,8 @@ paths:
200:
description: OK
servers:
- url: https://127.0.0.1/v2
description: The local server without variables
- url: 'http://{server}.swagger.io:{port}/v2'
description: petstore server
variables:
Expand All @@ -1380,8 +1384,6 @@ servers:
- 'v1'
- 'v2'
default: 'v2'
- url: https://127.0.0.1/no_varaible
description: The local server without variables
- url: http://server.{version}.openapi-generator.tech
description: The openapi-generator test server
variables:
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-faraday/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 *https://127.0.0.1/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::AnotherFakeApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-faraday/docs/DefaultApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::DefaultApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-faraday/docs/FakeApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::FakeApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::FakeClassnameTags123Api

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-faraday/docs/PetApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::PetApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-faraday/docs/StoreApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::StoreApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-faraday/docs/UserApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::UserApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
32 changes: 26 additions & 6 deletions samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ class Configuration
attr_accessor :force_ending_format

def initialize
@scheme = 'http'
@host = 'petstore.swagger.io'
@scheme = 'https'
@host = '127.0.0.1'
@base_path = '/v2'
@server_index = nil
@server_operation_index = {}
Expand Down Expand Up @@ -290,6 +290,10 @@ def auth_settings
# Returns an array of Server setting
def server_settings
[
{
url: "https://127.0.0.1/v2",
description: "The local server without variables",
},
{
url: "http://{server}.swagger.io:{port}/v2",
description: "petstore server",
Expand Down Expand Up @@ -327,10 +331,6 @@ 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",
Expand All @@ -351,6 +351,10 @@ def server_settings
def operation_server_settings
{
"PetApi.add_pet": [
{
url: "http://127.0.0.1/v2",
description: "No description provided",
},
{
url: "http://petstore.swagger.io/v2",
description: "No description provided",
Expand Down Expand Up @@ -398,6 +402,10 @@ def operation_server_settings
}
],
"PetApi.delete_pet": [
{
url: "http://127.0.0.1/v2",
description: "No description provided",
},
{
url: "http://petstore.swagger.io/v2",
description: "No description provided",
Expand Down Expand Up @@ -445,6 +453,10 @@ def operation_server_settings
}
],
"PetApi.get_pet_by_id": [
{
url: "http://127.0.0.1/v2",
description: "No description provided",
},
{
url: "http://petstore.swagger.io/v2",
description: "No description provided",
Expand Down Expand Up @@ -492,6 +504,10 @@ def operation_server_settings
}
],
"PetApi.update_pet": [
{
url: "http://127.0.0.1/v2",
description: "No description provided",
},
{
url: "http://petstore.swagger.io/v2",
description: "No description provided",
Expand Down Expand Up @@ -539,6 +555,10 @@ def operation_server_settings
}
],
"PetApi.update_pet_with_form": [
{
url: "http://127.0.0.1/v2",
description: "No description provided",
},
{
url: "http://petstore.swagger.io/v2",
description: "No description provided",
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-httpx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 *https://127.0.0.1/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::AnotherFakeApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-httpx/docs/DefaultApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::DefaultApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-httpx/docs/FakeApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::FakeApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::FakeClassnameTags123Api

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-httpx/docs/PetApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::PetApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-httpx/docs/StoreApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::StoreApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-httpx/docs/UserApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::UserApi

All URIs are relative to *http://petstore.swagger.io:80/v2*
All URIs are relative to *https://127.0.0.1/v2*

| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
Expand Down
Loading
Loading