From 2a1167f90f04959679e4e681fb887dec440296fe Mon Sep 17 00:00:00 2001 From: Lukasz Gornicki Date: Wed, 29 Mar 2023 10:36:05 +0200 Subject: [PATCH] fix: adjust filters and config parsing for websocket protocol (#200) --- filters/all.js | 6 +++++- template/config/common.yml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/filters/all.js b/filters/all.js index ee6f786f..91b0603d 100644 --- a/filters/all.js +++ b/filters/all.js @@ -176,7 +176,11 @@ function getConfig(p) { let protocol = p; let configName = 'broker'; - if (p === 'ws') configName = 'ws'; + if (p === 'ws') { + configName = 'ws'; + return `config.${configName}`; + } + if (p === 'kafka-secure') protocol = 'kafka'; return `config.${configName}.${protocol}`; diff --git a/template/config/common.yml b/template/config/common.yml index d29d8ba8..1a4a3a18 100644 --- a/template/config/common.yml +++ b/template/config/common.yml @@ -4,7 +4,7 @@ default: version: {{ asyncapi.info().version() }} {% if asyncapi.server(params.server).protocol() === "ws" %} ws: - port: {{ asyncapi.server(params.server).url() | replaceVariablesWithValues(asyncapi.server(params.server).variables()) | port(80) }} + port: {{ asyncapi.server(params.server).url() | replaceServerVariablesWithValues(asyncapi.server(params.server).variables()) | port(80) }} path: /ws topicSeparator: '__' {% endif %}