Skip to content

Commit

Permalink
fix template config validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Sep 27, 2023
1 parent f11ea47 commit 936abfb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/templateConfigValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ module.exports.validateTemplateConfig = (templateConfig, templateParams, asyncap
isRequiredParamProvided(parameters, templateParams);
isProvidedTemplateRendererSupported(templateConfig);
if (asyncapiDocument) {
let server;
if (usesNewAPI(templateConfig)) {

server = asyncapiDocument.servers().get(templateParams.server);
} else {
const server = asyncapiDocument.servers().get(templateParams.server);
isServerProvidedInDocument(server, templateParams.server);
isServerProtocolSupported(server, supportedProtocols, templateParams.server);
server = asyncapiDocument.servers()[templateParams.server];
}
isServerProvidedInDocument(server, templateParams.server);
isServerProtocolSupported(server, supportedProtocols, templateParams.server);
}

isProvidedParameterSupported(parameters, templateParams);
Expand Down

0 comments on commit 936abfb

Please sign in to comment.