Comments (8)
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.
from cli.
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.
from cli.
Related parser plugin: https://github.com/asyncapi/raml-dt-schema-parser
from cli.
hint for whoever will work on this:
- also add openapi and avro plugins
- this is how you register them https://github.com/asyncapi/generator/blob/master/lib/generator.js#L60-L62
from cli.
hello, wanted to confirm changes before I make a PR @derberg :
from cli.
@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?
from cli.
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 ❤️
from cli.
🎉 This issue has been resolved in version 0.29.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from cli.
Related Issues (20)
- [BUG] Release pipeline is blocked by the windows cache issue HOT 3
- [CLI] Add metadata for metrics collection in remaining commands
- [FEATURE] add optional flag `rawPropertyNames` to TypeScriptFileGenerator HOT 1
- [FEATURE] Automatic Version Update Notification HOT 3
- Improve `fromTemplate.test.ts` to avoid intermittent error on CI HOT 5
- Implement new UI/UX improvements in new command HOT 1
- Implement new UI/UX improvements in config command
- Implement new UI/UX improvements in convert command HOT 1
- Implement new UI/UX improvements in generate command HOT 1
- Implement new UI/UX improvements in optimize command HOT 3
- Implement new UI/UX improvements in start command HOT 11
- Implement new UI/UX improvements in validate command HOT 1
- [BUG] CLI installation takes a lot of time HOT 5
- Support for multiple versions of generator HOT 14
- [BUG] Command generate fromTemplate brakes with MODULE_NOT_FOUND HOT 4
- [BUG] File name is not captured while creating new asyncapi.yml from using new command HOT 2
- [FEATURE] Adding a progress bar for CLI Commands to show the progress status HOT 2
- [FEATURE] New command to publish the result generated by generate and model command. HOT 1
- [FEATURE] New Command to format the Asyncapi document HOT 2
- Replace request by node-fetch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.