-
-
Notifications
You must be signed in to change notification settings - Fork 197
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: enable Typescript Input #594
Conversation
Hey @jonaslagoni ! I made this draft PR for issue #187 . Please check it out and provide your feedback on whether I'm heading in the right direction. There's still a lot of work left like writing proper tests and adding more implementation features based on the library I'm using. |
aff4c5b
to
8d7dacd
Compare
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.
Nice progress! 🎉
I made this draft PR for issue #187 . Please check it out and provide your feedback on whether I'm heading in the right direction. There's still a lot of work left like writing proper tests and adding more implementation features based on the library I'm using.
I just realized that we run into a bit of a problem here 😄
Currently, the input type has always been one file, or rather one JSON object which of course wont fit here. So we need to adapt the input processing to accommodate these new input types.
Would you like to start the issue? 🙂
Sorry @jonaslagoni for the late reply, I was kinda busy with my university coursework. I'm also going to reply to the comments above here.
Yeah so is this the case for handling the whole Typescript project? For that, we need to use the Additionally, I'm trying to understand what more input types are we going to accept here? Since we either have to get the individual |
My recommendation is to start small, what is the absolute minimum we need to support in order to say we have this feature. So for now don't worry about projects, but a single file 🙂 (unless the library supports providing the content of a file that would be better 😄) I would suggest you took a look at how you can change the current processor line to follow this format: process(input: any): CommonInputModel {
if(typeof input !== 'string') throw error;
const pathToFile = input; As I dont know the library in and out, try to see what is possible and feel free to ping me with what worked and didnt 🙂 |
Pull Request Test Coverage Report for Build 1929157128
💛 - Coveralls |
@jonaslagoni So I guess this is the absolute base case of the implementation where I pass a There's a lot more features to add to this, like :
Also let me know if I need to improve on the documentation of the current implementation. |
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.
Looking good @ron-debajyoti 💪
A couple of things are missing until we can merge:
- We need to add it as a input to the input processor:
modelina/src/processors/InputProcessor.ts
Line 19 in 8a79fc0
this.setProcessor('default', new JsonSchemaInputProcessor()); - We need an example showing that it works similar to how we do for AsyncAPI inputs: https://github.com/asyncapi/modelina/tree/master/examples/asyncapi-from-object
- Check out https://github.com/asyncapi/modelina/blob/master/docs/contributing.md#adding-examples how to add examples 🙂
- We need to adapt the following documentation files:
- https://github.com/asyncapi/modelina#features where we add TypeScript files as supported input
- Add a new usage section that we can link the example to 🙂
461cc13
to
ff4007d
Compare
Hey @jonaslagoni . Here's the summary of the latest commits :
Please review and let me know if I had missed something. |
…-input-support
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.
Got a few comments, but overall it looks great 👍
@magicmatatjahu think it's time you take a look if you want to, as we have reached the final state before merging.
@magicmatatjahu this has been pending for review for many days 😅 |
Life of OpenSource unfortunately 😄 @magicmatatjahu do you want to review it, or can we go ahead? |
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.
Only one suggestion :) Rest lgtm. Awesome work!
Kudos, SonarCloud Quality Gate passed!
|
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 👍
/rtm |
🎉 This PR is included in version 0.51.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0-next.23 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
uniqueNames
,compilerOptions
java-from-typescript-type
andjava-from-typescript-type-with-options
.Related issue(s)
Fixes #187