Kong / Kong/insomnia

Ability to override global servers definition for a given route

Open
#4,425 1 comment 3 reactions 0 assignees View on GitHub
B-bug N-investigation PA-openapi-2-kong S-verified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### 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:
- url: http://global.endpoint
description: Define global endpoint

# kong defaults

paths:
/some/path:
post:
servers:
- url: http://another.endpoint
description: override the global servers array of
# rest of path definitions
```
2. Upload spec to Kong.
3. Attempt to hit `/some/path`

### Is there an existing issue for this?

- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### 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

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with the OpenAPI 3.0 example in the issue, using a global server and an overridden server on `/some/path`. Trace how Insomnia handles the uploaded specification and request routing; done means requests to `/some/path` use its server rather than the global server.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.