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: add x-parser-spec-parsed extension #288

Merged
merged 9 commits into from
Apr 23, 2021

Conversation

magicmatatjahu
Copy link
Member

@magicmatatjahu magicmatatjahu commented Apr 22, 2021

Description

Add x-parser-spec-parsed: true extension to root of parsed spec, similar like x-parser-message-parsed to avoid unnecessary calculations. I have use case when I stringify parsed spec (see issue) and after stringification I must pass this spec again to AsyncAPIDocument constructor. Also I fixed bug, because when we are assigning anonymous id of anonymous message we should first check that id is defined - for schemas we do it.

Related issue(s)
See asyncapi/html-template#166 (review) especially part with:

also this anonymous-message-1 should not be there 🤔 maybe my messages do not have name prop or title but they are in components and the key name should be applied right?

@magicmatatjahu magicmatatjahu marked this pull request as ready for review April 22, 2021 19:22
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

lgtm, can you just please add some comment here so we do not have to dig in the history later on to figure out why we assign this prop.

Tbh, we already have so many parser specific extensions that I think it is about time to think about documenting them 😅 what do you think?

@derberg
Copy link
Member

derberg commented Apr 23, 2021

also, tests are failing and sonarcloud complains, have a look

@magicmatatjahu
Copy link
Member Author

magicmatatjahu commented Apr 23, 2021

@derberg Thanks! I will fix tests and sonar clouds errors (I wrote PR yesterday about 23pm 😅).

Tbh, we already have so many parser specific extensions that I think it is about time to think about documenting them 😅 what do you think?

Something like that?

## Custom extensions

Parser during validation and parsing adds custom extensions (started by `x-parser`) that add additional information about the specification:

| Name | Value | Location | Description |
|---|---|---|
| `x-parser-spec-parsed` | `true` | Root of parsed specification | Indicates that specification is parsed |

@derberg
Copy link
Member

derberg commented Apr 23, 2021

I wrote PR yesterday about 23pm

then maybe I should actually do a deeper code review 🤔 😆

for the docs, you went to far, just add a comment in code, readme is something for a followup, don't spend to much on it now, just open an issue if you want

@sonarqubecloud
Copy link

Kudos, SonarCloud 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
0.0% 0.0% Duplication

@magicmatatjahu magicmatatjahu merged commit da21a70 into asyncapi:master Apr 23, 2021
@magicmatatjahu magicmatatjahu deleted the x-parser-parsed branch April 23, 2021 11:58
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.5.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants