-
-
Notifications
You must be signed in to change notification settings - Fork 127
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: show event examples #54
Comments
Hi @thim81 Can the Code Examples feature help with your case? |
Hey @thim81 , Thanks for the idea, just looking at everything now, I was certain this was supported already but I can't find anything 😅, yeah great idea. I guess we could add Following from @dytyniuk yeah I guess Code Examples could work there too, but I guess if we had an explicit place we could store this stuff might be better? Any ideas on where we could store examples of the events? My thoughts is add a new directory and if events are in there maybe the UI can render them, or user opt-in into new component |
hi @boyney123 Adding The tricky part will be the rendering part and I guess mostly the UI aspect, like where to put the example in the event details screen. Where to put this? |
hi @boyney123 I thought about your suggestion to add the
@thim81 does look like something helping with your issue? |
Maybe an MDX Component that people can choose where to put it. I might also explore some kind of component that allows people to put things side by side, in your example it could be <Splitter>
<SchemaViewer/>
<EventExample example="example1" />
</Splitter> This could render the things side by side and allow you to choose which event example to render |
@boyney123 The |
Yeah I like this solution, keeping the examples code in the one place, I will implement it and see how it feels and make sure it does not impact the other components. Thanks! |
Just thinking of this some more, once this in is place, it would be interesting to extend the asyncapi generator to dump the "examples" in the appropriate files. |
Have you read the Contributing Guidelines on issues?
Description
Currently the application can display an Event Schema (JSON schema representation) and Code Examples.
It would also be nice to show an example of the "event" itself, especially if the event is in a JSON or non-binary format.
Where you see the "Event Schema" and the "Event Example" next to each other.
Example: https://redocly.github.io/redoc/#tag/pet
Motivation
A common use-case for event documentation, is to have an actual example that makes the documentation and event very visual. An event schema describes the properties and the details on these properties. An event example shows the event content/data.
The text was updated successfully, but these errors were encountered: