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 support to display examples #53

Merged
merged 3 commits into from
Aug 16, 2021
Merged

Conversation

ITman1
Copy link
Contributor

@ITman1 ITman1 commented May 7, 2021

Description

  • When example attribute is specified alongside with type/record field definition it is propagated into examples attribute of AsyncAPI schema
  • Tested locally and on REACT component playground

image

Related issue(s)
Implements example feature from #18

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. 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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 7, 2021

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
No Duplication information No Duplication information

@derberg
Copy link
Member

derberg commented May 11, 2021

@ITman1 fyi, I asked the community to share their opinion on a related issue as I'm not sure if we should actually provide such a support

@ITman1
Copy link
Contributor Author

ITman1 commented May 11, 2021

@derberg That is good question, main problem I see that it is not standardized anywhere, but AFAIK Avro Schema does not disalow to define those attributes.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Jul 11, 2021
@derberg derberg removed the stale label Jul 26, 2021
@derberg
Copy link
Member

derberg commented Jul 26, 2021

@ITman1 please update with latest master

@ITman1
Copy link
Contributor Author

ITman1 commented Jul 27, 2021

@derberg Updated from upstream repo

@bpb54321
Copy link

When will this be merged? I would like to use this ASAP in my project.

@derberg
Copy link
Member

derberg commented Jul 29, 2021

@bpb54321 I want to wait at least until the end of the week. Maybe @iemejia called out by @ITman1 will have time to have a look and will share his opinion on this. Otherwise next week definitely.

@derberg
Copy link
Member

derberg commented Jul 29, 2021

@ITman1 please have a look at failing linter, it complains on the complexity of the code

@ITman1
Copy link
Contributor Author

ITman1 commented Aug 1, 2021

@derberg Tried to extract some code into seperate functions, Sonar does not complain anymore locally. Both tests started to fail after my change so I also adjusted expected test results. IMHO there was a bug, Avro can have 'null' as default values, before null was ignored from the spec files and so does also 0 I would guess.

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.

one tiny request to add one additional comment to the code + please update readme with information of extra fields support

to-json-schema.js Show resolved Hide resolved
@M3lkior
Copy link
Collaborator

M3lkior commented Aug 13, 2021

@ITman1 fyi, I asked the community to share their opinion on a related issue as I'm not sure if we should actually provide such a support

From my side, it could be nice to have this feature merged. Here is the result of my generation based on avsc files ; all the attributes are null ; handle the example attribute could improve the reader experience ;)

image

@sonarqubecloud
Copy link

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

@derberg
Copy link
Member

derberg commented Aug 16, 2021

@ITman1 hey, sorry I did not notice you made required changes, if @M3lkior would not add his comment, I would miss it. There are too many PRs in many different repos. Next time you contribute (I hope you will 😄 ) please use the button to re-request review to trigger a notification.

@derberg derberg merged commit 7a95c0f into asyncapi:master Aug 16, 2021
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.3.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.

5 participants