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

Add JSON Schemas for available options in languages #595

Closed
magicmatatjahu opened this issue Jan 21, 2022 · 9 comments
Closed

Add JSON Schemas for available options in languages #595

magicmatatjahu opened this issue Jan 21, 2022 · 9 comments
Labels
enhancement New feature or request stale

Comments

@magicmatatjahu
Copy link
Member

Currently, we have a serious problem with reusing options (or rather available values etc) for languages in other projects. Of course, if one uses a library in a TS project then has a typing that validates the passed options. The problem arises in the case when we want to validate these options in runtime and not at development time, e.g. in our cli (related PR and comment asyncapi/cli#173 (comment)), server-api or studio we have a problem because we don't currently provide this possibility. I think we should create JSON Scheme for each language and then we can reuse this json scheme in other projects.

So some benefits:

  • we will have on source of truth that we can consume in other projects
  • thanks to automatic bumping we won't have to edit options in other repos (they will consume them from JSON Schemas)
  • in cli we'll be able to validate parameters, in server-api also and we'll be able to create forms based on JSON Schemas in the studio :)
@magicmatatjahu magicmatatjahu added the enhancement New feature or request label Jan 21, 2022
@jonaslagoni
Copy link
Member

Hmm, maybe that is possible yea 🤔

That way I could reuse it in the website as well. Let me see what I can do.

@magicmatatjahu
Copy link
Member Author

magicmatatjahu commented Jan 31, 2022

@jonaslagoni In the future we should switch the playground in the website to the Studio, but it's an idea to update "forms" only in the modelina repo and reuse in other projects.

@jonaslagoni
Copy link
Member

jonaslagoni commented Jan 31, 2022

Tbh, I feel like modelina together with docs, playground examples and use-cases need its own website at some point, time is just not right just yet 😛 Of course if you want studio to integrate modelina playground as well I wont stop you 😆

@jonaslagoni
Copy link
Member

There are some blockers I see making this a reality, unfortunately, it all comes back to $ref and having no tools. Gonna keep the issue open for later though.

@magicmatatjahu
Copy link
Member Author

@jonaslagoni Do you mean that problems related to reference using $id?

@jonaslagoni
Copy link
Member

jonaslagoni commented Feb 4, 2022

That and references are not looked up by tooling under definitions, meaning it will be difficult to have separate schemas and bundle them together.

And the idea was to generate the option types through Modelina itself from the schema files so we use them as a single source of truth. Both for CLI, playground, and generator arguments.

I did a quick test here:

I.e. currently #608 blocks the progress.

I tried to do some manual changing of the complete schema, and I can get it to work: https://github.com/jonaslagoni/generator-model-sdk/tree/feature/options-json/tools/typegenerator/output, but then I ran into #610 😆

@jonaslagoni
Copy link
Member

jonaslagoni commented Feb 4, 2022

Of course, we could skip the type generation for now, but then I feel like it won't be worth the problems 😄

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2022

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Jun 8, 2022
@github-actions github-actions bot removed the stale label Jul 29, 2022
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Nov 28, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants