Skip to content

[FEATURE] Custom domain and header support #111

@noraj

Description

@noraj

Prerequisites

  • Searched for existing feature requests that may address the problem.

Problem or Use Case

When importing a swagger file that does not include a domain, this extensions add a example.com placeholder domain.

openAPI.getServers().forEach(server -> {
String serverUrl = Optional.ofNullable(server.getUrl())
.filter(url -> url.startsWith("http://") || url.startsWith("https://"))
.orElse("https://example.com");

So for each request, the user have to edit the host header and the domain in the target to be able to send the request.

Proposed Solution

Add settings in the extension that allow to configure a custom domain, so the extension would prepare the requests with that domain instead of example.com and won't have to edit the domain in all requests.

Similarly, an option to add headers could be useful, so when the file is parsed, the custom headers are added to all requests (e.g. a cookie or auth token) so the users don't have to add it manually on each request.

Alternative Solutions Considered

I don't see an alternative

Example

If defined use custom domain set in settings else use default example.com.

It could also have priority, if set, over a domain in the swagger file, in case the user want to overwrite it.

Add any other context, screenshots, or references about the feature request here.

N/A

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions