Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.57k stars 1.96k forks source link

Ability to override global servers definition for a given route #4425

Open ajsaclayan opened 2 years ago

ajsaclayan commented 2 years ago

Expected Behavior

Have the ability to define a separate upstream for a specific path in OpenAPI v3.0. When that specific path is called, Kong routes the request to the server defined in the path instead of the global servers.

Actual Behavior

Kong does not acknowledge overridden upstream. This is a feature as part of OpenAPI 3.0 (https://swagger.io/docs/specification/api-host-and-base-path/ under Overriding Servers)

Reproduction Steps

  1. Define an OpenAPI spec where a specific path has a different upstream than the global definition. Simplified spec for relevancy.
    
    openapi: 3.0.1
    info:
    title: Example spec
    description: Example spec
    version: 1.0.0

servers:

kong defaults

paths: /some/path: post: servers:

Is there an existing issue for this?

Additional Information

Similar issue https://github.com/Kong/insomnia/discussions/3627

Insomnia Version

Insomnia CLI version 2.4.0

What operating system are you using?

Windows

Operating System Version

Windows 10 version 1909

Installation method

Download from GitHub releases

Last Known Working Insomnia version

N/A

filfreire commented 2 years ago

Hi @ajsaclayan, thanks for reporting this!

As of now we don't officially support this. See the note on upstreams section of our doc, related with https://github.com/Kong/insomnia/pull/4262.

I'm not entirely sure yet if the Kong declarative config schema itself supports this, in order for us to also make this change on Insomnia's openapi-2-kong converter. If anyone that bumps into this issue knows if Kong supports this on the config side, please ping here.

@ajsaclayan we'll try to update this GH issue as soon as there's any news or a potential fix. Feel free to report any other issues you may bump into while using Insomnia.