-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
File path as input to the generator #1591
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. |
Makes sense to me 👍 Want to contribute it @nilkanth987 ? |
@jonaslagoni , Yes I want to contribute. |
Awesome! Let me know if you need any help 😄 |
Hmm, yea might not be as easy to implement as first thought 😄 Cause we need to try and preserve the current architecture with processors and generators. One generator preferably should not know about the input (how to handle it) but just give it to the processor. Dilemma is, right now processors are interpreting the input entirely on their own, which makes it hard to know if its an url for an AsyncAPI document, or JSON Schema for example. I think the best cause of action is to add a input processor type called Then the input in these cases are just an url, thats it. Now you should be able to pass That way all generators already understand this new input and all you have to change is 2 files. Does that make sense @nilkanth987 ? |
@jonaslagoni , Yes. Thanks for the guidance. I will implement it and let you know if I face any issues. |
🎉 This issue has been resolved in version 3.0.0-next.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 4.0.0-next.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Reason/Context
I am implementing AsyncAPI for the project that has huge set of REST APIs and Socket Events. To make things modularised and easy to read I have divided a single documentation into multiple files. Here is a reference to the file structure
These files are internally referenced so the modules are easy to read and edit.
Now when I try to create models using
@asyncapi/modelina
it accepts only parsed input. Even if I import a file and parse it to proved to the generated it will mess up the references in the fileDescription
Let the
generateToFiles
method of the generator accept the file path as input. And process and parse the file before supplying it to the Renderer.Yes
I propose a new method
generateFromFile
which will accept file as input and can output models to multiple files.The text was updated successfully, but these errors were encountered: