Skip to content

Commit

Permalink
Change generator for onlyModels parameter
Browse files Browse the repository at this point in the history
UP-8127
  • Loading branch information
Timo Du Four committed Feb 9, 2024
1 parent 39d515e commit 904cf53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/02_removeNotRelevantParts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
if (!hasAmqp) {
// remove filers from template related only to amqp
}
if (!hasMqtt) {
if (!hasMqtt || generator.templateParams.onlyModels) {
// remove filers from template related only to mqtt
fs.unlinkSync(path.resolve(generator.targetDir, 'src/test/java/com/asyncapi/TestcontainerMqttTest.java'));
}
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@
"default": false,
"required": false
},
"onlyModels": {
"description": "Only generate the models for mqtt, not the config and test. This was added by Unifly because the generated config and test don't support custom converters",
"default": false,
"required": false
},
"maven": {
"description": "Generate pom.xml Maven build file instead of Gradle build",
"default": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
{{- amqpConfig(asyncapi, params) -}}
{%- endif -%}
{%- if asyncapi | isProtocol('mqtt') -%}
{%- if params.onlyModels !== true %}
{{- mqttConfig(asyncapi, params) -}}
{%- endif -%}
{%- endif -%}
{%- if (asyncapi | isProtocol('kafka')) or (asyncapi | isProtocol('kafka-secure')) -%}
{{- kafkaConfig(asyncapi, params) -}}
{%- endif -%}

0 comments on commit 904cf53

Please sign in to comment.