Skip to content

refactor: add Avro Schema Parser - #576

Merged
asyncapi-bot merged 4 commits into
asyncapi:next-majorfrom
smoya:feat/avroSchemaParser
Aug 26, 2022
Merged

asyncapi-bot merged 4 commits into
asyncapi:next-majorfrom
smoya:feat/avroSchemaParser

Conversation

@smoya

@smoya smoya commented Aug 11, 2022

Copy link
Copy Markdown
Member

Description

This PR does the following:

Note
There are some TODOs I left in purpose to have a discussion.

Related issue(s)
#480


async function parse(input: ParseSchemaInput<unknown, unknown>): Promise<AsyncAPISchema> {
const asyncAPISchema = await avroToJsonSchema(input.data as AvroSchema);
const message = (input.meta as any).message

@smoya smoya Aug 11, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The big change VS what we had previously is that the new interface passes directly the Schema in input.data rather than the message object.
I decided to add the message object in the input.meta and only in case it is there, do the modifications (if they are being done here finally).

cc @magicmatatjahu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will remember about that :) Avro parser there is a bit problematic 😅

@derberg

derberg commented Aug 16, 2022

Copy link
Copy Markdown
Member

I'm not involved in rewriting to TypeScript, so this might be silly question, but why are you porting avro schema parser here inside the parser?

@smoya

smoya commented Aug 16, 2022

Copy link
Copy Markdown
Member Author

I'm not involved in rewriting to TypeScript, so this might be silly question, but why are you porting avro schema parser here inside the parser?

Even though there are unit tests, the idea is to have everything here, to do proper testing of the parser with those schema parsers, and once we confirm everything works as expected, to move the code to each schema parser repo.

@fmvilas fmvilas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Pinging @dalelane and @M3lkior as they're both code owners of the Avro schema parser repo.

@magicmatatjahu magicmatatjahu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I left some comments :) Please refer to them and we can merge it :)

Comment thread src/schema-parser/avro-schema-parser.ts Resolved
Comment thread src/schema-parser/avro-schema-parser.ts Resolved
Comment thread src/schema-parser/avro-schema-parser.ts Resolved
Comment thread src/schema-parser/avro-schema-parser.ts Resolved
Comment thread src/schema-parser/avro-schema-parser.ts Resolved
@smoya
smoya requested review from magicmatatjahu and removed request for asyncapi-bot-eve, derberg and jonaslagoni August 25, 2022 09:04
Comment thread src/schema-parser/avro-schema-parser.ts Resolved
@smoya
smoya requested a review from magicmatatjahu August 25, 2022 15:46

@magicmatatjahu magicmatatjahu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀 Should we wait for review of parser's maintainers?

@smoya

smoya commented Aug 26, 2022 •

Copy link
Copy Markdown
Member Author

We can merge now as we have two approvals from code owners.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@smoya

smoya commented Aug 26, 2022

Copy link
Copy Markdown
Member Author

/rtm

@asyncapi-bot
asyncapi-bot merged commit 8c976e8 into asyncapi:next-major Aug 26, 2022
@smoya
smoya deleted the feat/avroSchemaParser branch August 26, 2022 07:50
magicmatatjahu pushed a commit to magicmatatjahu/parser-js that referenced this pull request Oct 3, 2022
derberg pushed a commit that referenced this pull request Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants