Skip to content
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

The official website's command to try is not even working in the first place #3522

Open
hskang9 opened this issue Dec 19, 2024 · 14 comments · May be fixed by #3545
Open

The official website's command to try is not even working in the first place #3522

hskang9 opened this issue Dec 19, 2024 · 14 comments · May be fixed by #3545

Comments

@hskang9
Copy link

hskang9 commented Dec 19, 2024

Describe the bug

I used the example from the website to generate api documentation, and it does not work

To Reproduce

Steps to reproduce the behavior:

  1. Copy command in asyncapi.com
  2. Run on terminal
  3. It does not work and show that the library is deprecated.

Expected behavior

It should generate something in example

Copy link

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.

maskedwolf4 referenced this issue in maskedwolf4/spec Dec 27, 2024
…sole. It was solved by adding install.sh which is a script to hide the deprecated output and modified validate-examples.yml by giving cmd to run install.sh this solve the issue
@derberg derberg transferred this issue from asyncapi/spec Dec 28, 2024
Copy link

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.

@derberg
Copy link
Member

derberg commented Dec 28, 2024

issue is related to new releases of generator and html-template, and since commands from https://www.asyncapi.com/tools/generator use always latest releases, then they do not work anymore

fix should be to make sure specific html template version is used: @asyncapi/[email protected] and add --use-new-generator flag.

asyncapi generate fromTemplate https://bit.ly/asyncapi @asyncapi/[email protected] -o example --use-new-generator

of course it needs to be checked first, then updated on website

also, docker command should be updated probably

@SahilDahekar
Copy link
Contributor

@derberg so the fix should be to just update the commands on website ?

Copy link
Member

derberg commented Jan 2, 2025

@SahilDahekar but of course they have to be checked manually on local, just to be 100% sure these is the right fix.

@SahilDahekar
Copy link
Contributor

@derberg The command you shared work normally but in docker it doesnt .

image

Also just after running the docker container normally it is exited . Is it normal or something i'll have to look into ?

image

@SahilDahekar SahilDahekar linked a pull request Jan 4, 2025 that will close this issue
@derberg
Copy link
Member

derberg commented Jan 7, 2025

exiting is not wrong, it just does it at the end of the operation.

it is weird that in your case docker is somehow not able to make a request outside container to fetch https://bit.ly/asyncapi

did you try other commands, like asyncapi validate https://bit.ly/asyncapi

@SahilDahekar
Copy link
Contributor

SahilDahekar commented Jan 7, 2025

@derberg It is working for generate command but doesnt seem to work with validate command

image

@derberg
Copy link
Member

derberg commented Jan 7, 2025

It is working for generate command - but you wrote it doesn't, screen shot also shows it doesn't

can you share terminal outputs as markdown code, not screen shots please

@SahilDahekar
Copy link
Contributor

Here are outputs in markdown format :

Generate Command :

docker run --rm -it --user=root --network host -v ${PWD}/example:/app/example -v ${PWD}/output:/app/output asyncapi/cli generate fromTemplate https://bit.ly/asyncapi @asyncapi/[email protected] -o example --use-new-generator

Here is the generate command output - It is working

AsyncAPI anonymously tracks command executions to improve the specification and tools, ensuring no sensitive data reaches our servers. It aids in comprehending how AsyncAPI tools are used and adopted, facilitating ongoing improvements to our specifications and tools.

To disable tracking, please run the following command:
  asyncapi config analytics --disable

Once disabled, if you want to enable tracking back again then run:
  asyncapi config analytics --enable

Skipping submitting anonymous metrics due to the following error: AbortError: This operation was aborted
┌  AsyncAPI Generator
│
◐  Generation in progress. Keep calm and wait a bit[BABEL] Note: The code generator has deoptimised the styling of /libraries/node_modules/generator-v2/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.
◇  Check out your shiny new generated files at example.

Skipping submitting anonymous metrics due to the following error: AbortError: This operation was aborted

Validate Command :

docker run --rm -it --user=root --network host -v ${PWD}/example:/app/example -v ${PWD}/output:/app/output asyncapi/cli validate https://bit.ly/asyncapi

Output for validate command - It is also working now

AsyncAPI anonymously tracks command executions to improve the specification and tools, ensuring no sensitive data reaches our servers. It aids in comprehending how AsyncAPI tools are used and adopted, facilitating ongoing improvements to our specifications and tools.

To disable tracking, please run the following command:
  asyncapi config analytics --disable

Once disabled, if you want to enable tracking back again then run:
  asyncapi config analytics --enable


URL https://bit.ly/asyncapi is valid but has (itself and/or referenced documents) governance issues.
Warnings 
https://bit.ly/asyncapi
 1:1  warning  asyncapi-id            AsyncAPI document should have "id" field.
 1:1  warning  asyncapi2-tags         AsyncAPI object should have non-empty "tags" array.
 2:6  warning  asyncapi-info-contact  Info object should have "contact" object.            info

✖ 3 problems (0 errors, 3 warnings, 0 infos, 0 hints)

Information 
https://bit.ly/asyncapi
 1:11  information  asyncapi-latest-version  The latest version of AsyncAPi is not used. It is recommended update to the "3.0.0" version.  asyncapi

✖ 1 problem (0 errors, 0 warnings, 1 info, 0 hints)

The only problem i see now is that sometimes its not able to fetch the yaml from the bitly link https://bit.ly/asyncapi

@derberg
Copy link
Member

derberg commented Jan 8, 2025

Skipping submitting anonymous metrics due to the following error: AbortError: This operation was aborted

this is weird error, you might want to report it to asyncapi/cli repo. Just specify that it happens in docker.

ok, so all is working fine then 💪🏼 did you update the PR you created initially?

@SahilDahekar
Copy link
Contributor

Sure @derberg will create a issue for that in asyncapi/cli repo.

And about the PR there are no changes to be made the above commands are the same as in the initial PR .

@derberg
Copy link
Member

derberg commented Jan 8, 2025

ok, just to clarify

  • --network host is needed right? why?
  • your PR should address issues only with html-template and you made a change to all the other templates that are not even on v3

@SahilDahekar
Copy link
Contributor

@derberg

  • --network host is needed because docker fails to download/find the bitly link normally.
  • For all other templates i am reverting back the changes. Initially i thought we need to make changes to each one of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants