-
-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Describe the bug.
Currently, using the HTML-Template to generate docs, and using the singleFile: 'false' option behaves very weirdly. If it's either 'true' or true then it's fine, but if it's 'false' or false it doesn't behave as you would expect in either case.
The docs for @asyncapi/html-template state this value should be a string.
If it's a string of 'false' (which is a truthy value - likely partially the source of the issue), it incorrectly generates the index.html as the singleFile format - the same as if you were to use a truthy value. However, it ALSO generates the docs as external dependencies, as you would expect it to when the value is set to false.
If it's a boolean of false then it correctly generates the file without the dependencies inside of it, like you would expect. However, it does not generate the external dependencies which it needs to work.
Tested using versions:
Node v22.2.0
@asyncapi/generator: 2.7.0
@asyncapi/parser: 3.4.0
@asyncapi/html-template on 2025-07-11 (so probably pulling v3.3.0)
Stretch goal:
It would also be a nice value add to me if there were additional options to:
- intentionally generate the minimal documentation without the external dependencies, for the use case where I'm generate a bunch of different documentation and wish to point it all to the same self-hosted JS/CSS dependencies. This means I can save space and time when generating docs.
- generate only the dependencies, which I can run when I build and deploy the server I host those dependencies on.
I understand my use case may not be worth specifically catering to. I can cope with that, it's just a nice-to-have.
Expected behavior
Both false and 'false' behave the same, and generate the minimal documentation which relies on external deps, and also generate those deps.
Screenshots
How to Reproduce
https://github.com/michael-ball-ctct/async-api-generator-singlefile-bug-demo
- Clone minimal repoduction and navigate to its directory.
npm install.npm run start.- Read test output/inspect files generated in
./docs
🖥️ Device Information [optional]
- Operating System (OS): Ubuntu 22.04.5 LTS
- Browser: N/A
- Browser Version: N/A
👀 Have you checked for similar open issues?
- I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
NB: In theory, I'm happy to contribute a PR to help push this along. In practice, I'm not really even sure where to start with this as I don't have a deep understanding of the internals of AsyncAPI, and I'm unsure how much time I'll be able to dedicate to this.