Allow sending schema to AsyncAPI playground via URL parameter #126
DefCon-007
started this conversation in
zArchived - AsyncAPI Hack 2021 - Submissions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Pull Request: asyncapi-archived-repos/playground#204
Background
Currently, the only way to load schema in the play ground directly via the URL is to use the
load
orurl
parameter which requires the schema file to be hosted somewhere and limits the usage.Sending schema as it is in the URL is not possible hence this change allows the users to send the base64 encoded string of their schema and directly load it in the editor.
Implementation
On load, if the base64 URL parameter is present, we decode its value and send it to the editor as it is to create the preview of corresponding schema automatically.
Screenshots and working
For the example, I used the YAML schema from the example present here and to minify the generated base64 encoded string I converted it to JSON and minified it.
Converting to JSON and minifying is completely optional.
Now, on opening this URL locally, I got the following view.
Usage
This will allow linking the schemas from various different places say chatbot or webpages easy, allowing faster adoption and easier edits.
Beta Was this translation helpful? Give feedback.
All reactions