-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Example override for ref schema object not working and HTML operations direct links not working #463
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. |
FWIW I went back to an older version of the generator and html-template and I was at least able to get the example and description overrides to work:
|
@christianrowlands thanks for the issue and apologies for delay in answering. We were super focused on shipping AsyncAPI v3. So if I understand there are 2 separate issues:
Pro tip, maybe consider to use message examples feature from AsyncAPI instead providing |
Thank you for the update @derberg. I went ahead and tried out the latest version that was dropped for html-template (2.1.0), and noticed that the fix in the pr asyncapi/asyncapi-react#887 was released in version 1.2.13 of Thank you @jonaslagoni for fixing that bug! I will try generating the docs again with html-template once version 2.1.1 (or 2.2.0) is released. Note: This comment also applies to this issue (mentioning it here to keep the tickets linked since they overlap). |
Since I originally put two bugs in this one issue, and that is generally a bad practice, I went ahead and split it out into two issues. I moved the override $ref bug in the new issue here. That will allow this issue to be closed once the html-template starts referencing version 1.2.13 of |
Describe the bug
Greetings. I have been using this AsyncAPI html-template for years now and it has made documentation creation very easy, so thank you for that!
I have a couple minor bugs that I want to report.
example
that I set for a field is not being used in the generated HTML when using a$ref
to a schema.I have published my AsyncAPI HTML docs on public URL, so you can see both issues on that site.
For # 1, if you look at any of the Payload schemas, they all have a
messageType
field. A couple months ago I noticed that the override description and example stopped working. For example, with the GSM Record under thegsm_message
operation, themessageType
should beThe type of message, must be GsmRecord.
since that is what I set it to here in the yaml spec.In addition, the
example
is also not being overridden as expected. I set it toGsmRecord
here in the yaml spec but in the generated doc it shows up asstring
. Below is a screenshot of the linked generated HTML:For # 2, here is a "direct link" to one of the operations. About 9 months ago this direct link worked, but at some (probably when I upgraded to a new version) the direct link stopped working: https://messaging.networksurvey.app/#operation-subscribe-nr_message
Once on the page, you can click any of the operations or any of the messages on the side bar and it does not take you to the appropriate section. However, all the "Schema" links work as expected.
How to Reproduce
For reproducing the issue, you can either use the full yaml spec I have linked to that is in my GitHub repo, or you can use this condensed version I made below. I typically use the docker container for asyncapi to generate the yaml. Something like:
docker run --rm -it -v ${PWD}/asyncapi/test.yaml:/app/test.yaml -v ${PWD}/testdoc:/app/output asyncapi/generator:1.15.1 /app/test.yaml @asyncapi/[email protected] -o /app/output --force-write
Expected behavior
The expected behavior is
messageType
value in the generated example json code block should have a value ofGsmRecord
.The type of message, must be GsmRecord.
Thanks again for creating this html-template and let me know if you need any more details or examples.
The text was updated successfully, but these errors were encountered: