stoplightio / http-spec

Utilities to normalize OpenAPI v2 and v3 objects for the Stoplight ecosystem.

Home Page:https://stoplight.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open API v2 Server URL

ellyxc opened this issue · comments

Context

Swagger v2 host and schemas are not mandatory (at least from documents i could find). But the following transformer is requesting them

if (typeof host !== 'string' || host.length === 0) {
return;
}
if (!isString(scheme) || !isValidScheme(scheme)) return;

Current Behavior

It is not returning server address

Expected Behavior

It is using current browser host as server url, or basePath only similar to OAS v3