Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Add base64 URL parameter to allow dynamic schemas #204

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DefCon-007
Copy link

Background

Currently, the only way to load schema in the play ground directly via the URL is to use the load or url 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.

Screenshot 2021-10-21 at 7 17 31 PM

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 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

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
Contributor

derberg commented Dec 9, 2021

@DefCon-007 I'm not sure we want to work on this for the playground as studio.asyncapi.com is really the main focus and soon Playground will most probably be archived or something like this. @magicmatatjahu what do you think? and I think you have it in the studio already right?

@magicmatatjahu
Copy link
Contributor

@DefCon-007 @derberg Exactly, the Studio from far long has a base64 parameter, as well as you can add specifications saved in base64 within the UI. I do not know how long it will take to integrate and automate with DigitalOcean, but when we will release a https://github.com/asyncapi/server-api then we will archive the playground right away :)

@magicmatatjahu
Copy link
Contributor

magicmatatjahu commented Mar 1, 2022

@DefCon-007 Hello and sorry for such a late response. We will be archiving the Playground in the near future so I suggest you to use the https://studio.asyncapi.com/ which is the successor of the Playground but with that same and much more capabilities. We also have a Docker Image - https://github.com/asyncapi/studio#using-it-via-docker. We are no longer mainataning the playground, we will be redirecting to the studio. Sorry for problems!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants