-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template watcher does not work with global templates #537
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue. |
@chatne just curious, why you need a watcher for a global template? watcher is for template development |
Yeah I just noticed the note in the generator help. Anyway I found it very convenient for messing around since it also watches the API document. I am not (yet) an expert on how to write coherent API documents so I wanted to see how things look while I write and edit the specification. The watcher made this a whole lot less annoying. I wonder if anyone else is doing the same. This is not an important improvement since I already figured out a workaround. Maybe if the generator is smart enough to find global templates now it would not be too hard for the watcher to do the same? Of course I might be wrong. |
Maybe if the watcher followed the same logic with the generator the parameter could just be Or I just write my own filewatcher since my specification is split to multiple documents now and the generator watcher only sees the main one. |
I also had this use-case before, not the part about watching the global template (unless someone comes with a use-case for that), but use the watcher to trigger documentation changes. I suggest we adapt the watcher to "try" watch files, if it cant it logs errors if Thoughts? |
tbh, if there is a documented workaround, then I would focus on making sure new watcher here https://github.com/asyncapi/cli covers all required use cases. Maybe better to close this issue saying we recommend using a workaround for now, and open a new issue in the CLI, and list there all possible use cases? |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
closing in favour of asyncapi/cli#73 |
Template watcher does not work with global templates
Recently added support for globally installed templates #530 does not mention anything about
--watch-template
related functionality and the watcher does not seem to work with global templates.When using watch template with globally installed template, the generator fails with:
How to reproduce
Using the following Dockerifile
and building using
docker build -t agissue .
Generating works fine:
But generating with watcher does not:
Failure output:
Workaround
The watcher works if the template is locally installed. To preload the template I installed it using dummy.yaml generation during the image build.
And now the generator works with and wihtout the watcher enabled:
The text was updated successfully, but these errors were encountered: