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

not getting the right error when calling asyncapi validate or asyncapi start studio without context and without file in work dir #148

Closed
derberg opened this issue Nov 23, 2021 · 1 comment · Fixed by #174
Assignees
Labels
bug Something isn't working released

Comments

@derberg
Copy link
Member

derberg commented Nov 23, 2021

When I have no context and no asyncapi file in my work dir I get: ContextError: No context is set as current, please set a current context but should get:

Unable to perform validation. Specify what AsyncAPI file should be validated.
These are your options to specify in the CLI what AsyncAPI file should be used:
  - You can provide a path to the AsyncAPI file: asyncapi validate path/to/file/asyncapi.yml
  - You can also pass a saved context that points to your AsyncAPI file: asyncapi validate mycontext
  - In case you did not specify a context that you want to use, the CLI checks if there is a default context and uses it. To set default context run: asyncapi context use mycontext
  - In case you did not provide any reference to AsyncAPI file and there is no default context, the CLI detects if in your current working directory you have files like asyncapi.json, asyncapi.yaml, asyncapi.yml. Just rename your file accordingly.

I think we need to pull https://github.com/asyncapi/cli/blob/master/src/errors/validation-error.ts#L19 to more generic error and also fix

return await loadFromContext();

more details #130 (comment)

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.13.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants