Skip to content

Generator do not handle template params that default to false #1768

@derberg

Description

@derberg

checked with latest 3.3.1

Problem might be in https://github.com/asyncapi/generator/blob/master/apps/generator/lib/templates/config/loader.js#L47. Tests should be checked for loadDefaultValues.

in html-template config https://github.com/asyncapi/html-template/blob/master/package.json#L90-L93 singleFile default is false. So if you do not pass this parameter, false value should be injected with context into generation process.

This false default value is critical for another setting (conditional generation): https://github.com/asyncapi/html-template/blob/master/package.json#L63-L75 which means that required css and js folders will be rendered in output only fi singleFile is set to false.

asyncapi generate fromTemplate test/spec/asyncapi_v3.yml ./ -o dupa --use-new-generator --force-write -p singleFile=false works as expected, false goes through, so directories are there. Of course flah singleFile=true works as well.


Problem is that during generation in case like asyncapi generate fromTemplate test/spec/asyncapi_v3.yml ./ -o dupa --use-new-generator --force-write the template gets singleFile as undefined (doesn't get it at all). I can only see the following defaults

{
  "outFilename": "index.html",
  "pdfTimeout": 30000
}

So there is for sure a bug in generator, it is not handling default values set to false

Originally posted by @derberg in #744

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions