Skip to content

Commit

Permalink
disable validation package installation for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushik-rishi committed May 4, 2024
1 parent 1c40743 commit c7914d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion template/package.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ export default function packageFile({ asyncapi, params }) {
dotenv: '8.1.0',
hermesjs: '2.x',
'hermesjs-router': '1.x',
'asyncapi-validator': '3.0.0',
'node-fetch': '2.6.0',
'node-yaml-config': '0.0.4',
};

const majorSpecVersion = parseInt(asyncapi.version().split('.')[0], 10);
const isSpecV3 = (majorSpecVersion === 3);
if (!isSpecV3) {
dependencies['asyncapi-validator'] = '3.0.0';
}

const serverProtocol = asyncapi.allServers().get(params.server).protocol();
if (serverProtocol === 'mqtt' || serverProtocol === 'mqtts') {
dependencies['hermesjs-mqtt'] = '2.x';
Expand Down

0 comments on commit c7914d5

Please sign in to comment.