-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
feat: integrate modelina
to generate models
#173
feat: integrate modelina
to generate models
#173
Conversation
PR is ready to be reviewed 🙂 |
@magicmatatjahu @fmvilas @Souvikns hey folks, can you remind me as I can find it anywhere but my brain is telling me that we had a discussion about this principle that @Souvikns I remember that at some point in time we were discussing that commands should be stored in separate files so they are then reused in source and tests and not duplicated. Was it done and lost during refactoring or? can't remembers, sorry :( |
@derberg is #59 (comment) what you are looking for |
@Souvikns not, not this one, this is about helping out if you do |
Yeah I can't find where we discussed that either. I think --file should not be a flag but an argument instead. Something like |
Yeah I would also be in favor of making the asyncapi file and language optional, so the call itself should look like this:
I also wonder if that long I also wonder if we should make as followup flag to load JS file to load config for given Langauge Generator? As you know user has possibility to change format of model name etc. and of course that config we cannot convert to the CLI flags/parameters. WDYT? |
yeah, actually should not there be support for |
@magicmatatjahu makes sense to me 👍 Regarding the other suggestions and discussions, I have no preference here, ping me once you reached a consensus on what needs to change 🙂 Then I apply all above mentioned changes in one go. |
I don't want this to be too late, but haven't you thought about being compatible with the cli generator, which we will move to this repository? E.g. the parameters for template are given by flags asyncapi generate types <asyncapi-file> <language> -p <name=value> We can also add JSON Schemas (in the modelina repo) for available parameters to the given language and we can validate these parameters by AJV. Some benefits by this solution:
What do you think? @jonaslagoni |
I have tried to move along with the suggestion, but current this is out of reach until we solve some serious problems with JSON Schema dereferencing tools. So for now, we have to hardcode it. |
# Conflicts: # package-lock.json # package.json
There is a large discrepancy between how files are provided to commands, some use Finished adapting all the suggestions. New CLI examples:
I like it, changed 👍
Another feature, that Modelina natively should support at some point, agree (similar to tsconfig.json) 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Do you also approve? You were involved here so want to make sure you are fine too
/dnm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment: Should we change generate types
to the generate models
?
@jonaslagoni some conflicts popped up after the last merge.
I do not have an opinion, we can support both 😄 |
# Conflicts: # README.md # package-lock.json # package.json
68f3fe4
I like
Fixed. |
So |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
models
is fine 🤷🏼
|
Alright, switched to models 👍 |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/rtm |
🎉 This PR is included in version 0.21.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This PR adds the basic command for generating models with Modelina to all support languages.
It follows:
Related issue(s)
fixes #129
blocked by asyncapi/modelina#540
blocked by asyncapi/modelina#536