Skip to content

Commit

Permalink
fix(execute): handle Server Objects overrides for OpenAPI 3.1.0 (#3223)
Browse files Browse the repository at this point in the history
Refs #2967
  • Loading branch information
char0n authored Nov 3, 2023
1 parent 7b69c04 commit 13fed9c
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 69 deletions.
125 changes: 61 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@
},
"dependencies": {
"@babel/runtime-corejs3": "^7.22.15",
"@swagger-api/apidom-core": ">=0.82.0 <1.0.0",
"@swagger-api/apidom-json-pointer": ">=0.82.0 <1.0.0",
"@swagger-api/apidom-ns-openapi-3-1": ">=0.82.0 <1.0.0",
"@swagger-api/apidom-reference": ">=0.82.0 <1.0.0",
"@swagger-api/apidom-core": ">=0.82.2 <1.0.0",
"@swagger-api/apidom-json-pointer": ">=0.82.2 <1.0.0",
"@swagger-api/apidom-ns-openapi-3-1": ">=0.82.2 <1.0.0",
"@swagger-api/apidom-reference": ">=0.82.2 <1.0.0",
"cookie": "~0.5.0",
"deepmerge": "~4.3.0",
"fast-json-patch": "^3.0.0-1",
Expand Down
2 changes: 1 addition & 1 deletion src/execute/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ function oas3BaseUrl({ spec, pathName, method, server, contextUrl, serverVariabl

// default to the first server if we don't have one by now
if (!selectedServerUrl) {
selectedServerObj = servers.at(0);
[selectedServerObj] = servers;
selectedServerUrl = selectedServerObj.url;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,11 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via URL a
},
},
"openapi": "3.1.0",
"servers": [
{
"url": "/",
},
],
},
}
`;
Expand Down Expand Up @@ -694,6 +699,11 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via URL a
},
},
"openapi": "3.1.0",
"servers": [
{
"url": "/",
},
],
},
}
`;
Expand Down Expand Up @@ -1639,6 +1649,11 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
"version": "1.0.0",
},
"openapi": "3.1.0",
"servers": [
{
"url": "/",
},
],
}
`;

Expand Down Expand Up @@ -1725,6 +1740,11 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
"version": "1.0.0",
},
"openapi": "3.1.0",
"servers": [
{
"url": "/",
},
],
},
}
`;
Expand Down Expand Up @@ -2507,6 +2527,11 @@ exports[`resolve OpenAPI 3.1.0 strategy given OpenAPI 3.1.0 definition via spec
"version": "1.0.0",
},
"openapi": "3.1.0",
"servers": [
{
"url": "/",
},
],
},
}
`;
Expand Down
Loading

0 comments on commit 13fed9c

Please sign in to comment.