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

feat: create a parser plugin to support RAML 1.0 data types as a schema format #142

Closed
GeraldLoeffler opened this issue Nov 22, 2021 · 8 comments · Fixed by #427
Closed
Labels
enhancement New feature or request good first issue Good for newcomers released stale

Comments

@GeraldLoeffler
Copy link

The AsyncAPI spec has been supporting RAML 1.0 data types as a RECOMMENDED schema format for some time: spec (https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#schema-formats-table . However, the CLI currently does not seem to use a parser plugin for this schema format (see https://asyncapi.slack.com/archives/CQVJXFNQL/p1637599807269900?thread_ts=1637599687.269800&cid=CQVJXFNQL): please add one.

@GeraldLoeffler GeraldLoeffler added the enhancement New feature or request label Nov 22, 2021
@github-actions
Copy link
Contributor

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.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@GeraldLoeffler GeraldLoeffler changed the title feat: create a parser plugin to support RAML 1.0 data types for schema formats feat: create a parser plugin to support RAML 1.0 data types as a schema format Nov 22, 2021
@jonaslagoni
Copy link
Member

jonaslagoni commented Nov 22, 2021

Related parser plugin: https://github.com/asyncapi/raml-dt-schema-parser

@derberg
Copy link
Member

derberg commented Nov 22, 2021

hint for whoever will work on this:

@magicmatatjahu magicmatatjahu added the good first issue Good for newcomers label Feb 23, 2022
@starlightknown
Copy link

hello, wanted to confirm changes before I make a PR @derberg :
image

@derberg
Copy link
Member

derberg commented Jul 28, 2022

@starlightknown omg, so sorry, I just noticed this by accident when I was doing a review of good first issues 😞

please always open a PR when you have something already, just mark it as draft. It is really easy to miss some comment in some issue. Still not a good excuse 😄 sorry 😞

The changes you suggest are good, but this is not the only place where we need it. The fetch-asyncapi-example.js is a script that we run during build. There is also a need to make a change in the CLI itself. Now, when I look at the code now, months after creation of this issue, things are getting more complicated IMHO, it is not that trivial anymore because, I see that in code we user parser directly already in diff.ts, validate.ts and models.ts. So the change you have in the screenshot would have to be duplicated in 3 different files, which already rings a bell that this is not the best way to do it. IMHO to solve this issue, a wrapper around parser should be introduced, and diff.ts, validate.ts and models.ts should be refactored to use the new wrapper.

@boyney123 @magicmatatjahu @Souvikns thoughts?

@magicmatatjahu
Copy link
Member

ParserJS is a single instance lib so we should only create parser.ta file with that code:

import { parse, registerSchemaParser } from '@asyncapi/parser';
import openapiSchemaParser from '@asyncapi/openapi-schema-parser';
import avroSchemaParser from '@asyncapi/avro-schema-parser';
import ramlDtSchemaParser from '@asyncapi/raml-dt-schema-parser';

registerSchemaParser(openapiSchemaParser);
registerSchemaParser(avroSchemaParser);
registerSchemaParser(ramlDtSchemaParser);

export { parse } 

and reuse that parse function in other places.

@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 26, 2022
asyncapi-bot pushed a commit that referenced this issue Jan 16, 2023
Co-authored-by: Joris Molnar <joris.molnar@mediaan.com>
Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.29.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers released stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants