OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.29k stars 6.44k forks source link

[BUG][Ruby] Pull Request #15162 Breaks Ruby Server Index Functionality #15610

Open ColeMurray opened 1 year ago

ColeMurray commented 1 year ago

Bug Report Checklist

Description
openapi-generator version

6.6.0, regression

OpenAPI declaration file content or url
openapi: "3.0.3"
info:
  title: Service
  description: Service responsible for being a service
  version: "1.0"
servers:
  - url: http://localhost:8080
    description: local server
  - url: https://staging-server.example.com
    description: staging server
  - url: https://prod-server.example.com
    description: production server

paths:
  /v1/endpoint:
    $ref: "./api/v1/service.yaml#/~services"

Usage:

Client.configure do |config|
  config.access_token = @http_token
  config.server_index = 2
end
Generation Details
Steps to reproduce

In https://github.com/OpenAPITools/openapi-generator/pull/15162, functionality was removed that allowed retrieving a specific operation per server index. This change breaks the functionality of using server_index, causing the incorrect server to be retrieved.

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/pull/15162

Suggest a fix

Revert the commit causing the regression

ColeMurray commented 1 year ago

cc: @Confusion