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

Export flags to specify which spec is currently supported by bundler #135

Open
Souvikns opened this issue Jul 31, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@Souvikns
Copy link
Member

Reason/Context

To facilitate seamless integration with other tools that implement bundler, we can enhance compatibility by exporting a designated flag or configuration option. This will effectively communicate the supported spec version, enabling smoother interactions between systems.

We can use the Problem library to define an error code that could be reused in other tools as well. Any tool implementing bundler can check if the spec bundler being used on, is supported or not and throw appropriate warnings and errors.

@Souvikns Souvikns added the enhancement New feature or request label Jul 31, 2023
@Souvikns
Copy link
Member Author

After researching, https://github.com/asyncapi/problem cannot be used how we thought it could be. So problem library does not store the error codes or anything it provides an interface to define errors. So in our case, we have two options

  • Define errors in the libraries, so libraries have a soft check for spec version and throw errors accordingly.
  • Define all the errors in CLI and export some flags, but this means this features will only work on CLI, not on other tools that are utilizing the libraries

In my opinion, it is better to update the libraries with soft checks so that they are failproof, which helps people that are using just the library. If the bundler does not support v3 bundler should throw that error.

cc. @derberg

@derberg
Copy link
Member

derberg commented Sep 11, 2023

yes, problem just gives a common interface. Every library should use it eventually. So bundler is basically a place where we use it as proof of concept, try how later in CLI we can rely on the error to show proper details to users. Then others should follow. But of course we need to take into account that some might not follow, and we need a kind of solution in CLI that will translate custom errors into the ones based on problem.

I'm just thinking what is the advantage of ☝🏼 comparing to a static info that one could provide in package.json

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

No branches or pull requests

2 participants