Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/src/lib/prepareServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function stripTrailingSlash(url: string) {
*
*/
export default function prepareServer(spec: Oas, url: string, variables: Record<string, string | number> = {}) {
let serverIdx;
let serverIdx: number | undefined;
const sanitizedUrl = stripTrailingSlash(url);
(spec.api.servers || []).forEach((server, i) => {
if (server.url === sanitizedUrl) {
Expand All @@ -25,7 +25,7 @@ export default function prepareServer(spec: Oas, url: string, variables: Record<
// If we were able to find the passed in server in the OAS servers, we should use that! If we
// couldn't and server variables were passed in we should try our best to handle that, otherwise
// we should ignore the passed in server and use whever the default from the OAS is.
if (serverIdx) {
if (serverIdx !== undefined) {
return {
selected: serverIdx,
variables,
Expand Down