modelina icon indicating copy to clipboard operation
modelina copied to clipboard

Add JSON Type definition support

Open jonaslagoni opened this issue 6 months ago • 5 comments

Reason/Context

It would be great to have support for JSON Type definition standard as supported inputs: https://jsontypedef.com/

To support it we need to add a new input processor, which you can read about how to add here: https://github.com/asyncapi/modelina/blob/master/docs/contributing.md#adding-a-new-input-processor

The TLDR; is that we want to convert their structure into our Meta Models. Unless there are tooling available to handle references, the initial implementation might not support this. Feel free to document the limitations of the implementation as needed in an input document: https://github.com/asyncapi/modelina/tree/master/docs/inputs

Happy to help further if you get stuck on something :v:

jonaslagoni avatar Jan 12 '24 01:01 jonaslagoni

Hi @jonaslagoni I was going through the modelina .readme and I think in this code:

image

  • This code for (const model in models) should be this for (const generatedModel in models)

else the whole code should be this:

for (const model in models) { 
  const generatedCode = model.result;
  const dependencies = model.dependencies;
  const modeltype = model.type;
  const modelName = model.modelName;
  ...
}```
If I am correct the just let me know and I will raise a PR instantly regarding this. Thanks!

sagarkori143 avatar Jan 19 '24 05:01 sagarkori143

You are right @sagarkori143 👍

jonaslagoni avatar Jan 19 '24 06:01 jonaslagoni

@jonaslagoni Is this still relevant? The website for jsontypedef is currently offline 😅

moritzkalwa avatar Feb 13 '24 11:02 moritzkalwa

https://github.com/jsontypedef still gets updates, so I am sure it is just a fluke 😄

So yea I would say it is 👍

jonaslagoni avatar Feb 13 '24 11:02 jonaslagoni