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

Why would I use schema store #1048

Closed
derberg opened this issue May 19, 2020 · 2 comments
Closed

Why would I use schema store #1048

derberg opened this issue May 19, 2020 · 2 comments

Comments

@derberg
Copy link
Contributor

derberg commented May 19, 2020

hi, I have some questions:

  1. What do you mean here https://schemastore.azurewebsites.net/json/#editors by Various editors and IDEs have direct support for schemas hosted on SchemaStore.org. What does it mean? would other IDEs block schemas hosted on different domains or?
  2. Is my assumption correct that I can have my schema in my servers but still use SchemaStore.org? when I look at https://schemastore.azurewebsites.net/api/json/catalog.json it looks like some schemas are hosted on github for example
  3. What fileMatch means? is my assumption correct that for example if I use VSCode and have a file that match the pattern, the autocompletion and tooltips will be added by default? and I do not have to explicitly add $schema to my file pointing to my schema?

Sorry for dumb basic questions but I just want to make sure I fullly understand how your service works before we make any decisions here asyncapi/spec#377

@GerryFerdinandus
Copy link
Contributor

Screen shot from are from Clion IDE (IntelliJ Platform). (Click the screen shot for hires picture)

  1. IDE download external schema from schemasstore.org by default. But you can also add schema URL inside the IDE that have nothing to do with schema store. So direct link to asyncapi schema is possible.
    Screenshot 2020-05-24 at 13 57 40
    Manually add direct link to asyncapi. No need for schemasstore.org. But this is extra work. Not user friendly. https://raw.githubusercontent.com/asyncapi/asyncapi/master/versions/2.0.0/schema.json
    Screenshot 2020-05-24 at 14 48 37
  2. Yes, use you own repository file. Example:

{
"name": "asyncapi V2.0.0",
"description": "asyncapi V2.0.0 file",
"url": "https://raw.githubusercontent.com/asyncapi/asyncapi/master/versions/2.0.0/schema.json"
},

{
"name": "asyncapi V1.2.0",
"description": "asyncapi V1.2.0 file",
"url": "https://raw.githubusercontent.com/asyncapi/asyncapi/master/versions/1.2.0/schema.json"
},

{
"name": "asyncapi V1.1.0",
"description": "asyncapi V1.1.0 file",
"url": "https://raw.githubusercontent.com/asyncapi/asyncapi/master/versions/1.1.0/schema.json"
},

{
"name": "asyncapi V1.0.0",
"description": "asyncapi V1.0.0 file",
"url": "https://raw.githubusercontent.com/asyncapi/asyncapi/master/versions/1.0.0/schema.json"
}

  1. correct. 'filematch' is needed so that the IDE know automatic what schema need to be used for verification.
    example I open .travis.yml
    On the bottom right it shows 'schema: travis' without any user interaction.
    Screenshot 2020-05-24 at 14 18 16

If I open one of the asyncapi yml file nothing happen. Notice the 'no JSON schema' on the bottom line.
Screenshot 2020-05-24 at 14 35 35

If i click on the 'no JSON schema' a list of schema selection will popup that I can select from. But asyncapi is not present on the list. Because it is not present in the catalog: https://github.com/SchemaStore/schemastore/blob/master/src/api/json/catalog.json

Screenshot 2020-05-24 at 14 38 44

I must create manually a JSON mapping. Extra work, not user friendly etc.
Screenshot 2020-05-24 at 14 48 37

To be able to select from the list manualy.
Screenshot 2020-05-24 at 14 45 58

To get this result. Notice at bottom right there is now 'Schema: asyncapi'
Screenshot 2020-05-24 at 14 52 59

Note:
if asyncapi used different file names the automatic schema selection will not work.
A manual schema selection via menu is then only two mouse click away. if present in schemasstore.org

@derberg
Copy link
Contributor Author

derberg commented May 24, 2020

@GerryFerdinandus thanks so much for taking the time and providing such a detailed response. It looks awesome, even if we want to store the schema on our servers, we can still register it at schemastore which is super perfect!

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

No branches or pull requests

2 participants