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 schema listing all Schema-Store JSON Schema docs #237

Merged
merged 2 commits into from
Jul 13, 2022

Conversation

smoya
Copy link
Member

@smoya smoya commented Jul 6, 2022

Description

Partially fixes #236, pending a PR on JSON Schema-Store repository.

This PR adds a new schema file that lists all JSON Schema files for all AsyncAPI spec versions. This is required for Schema-Store IDE plugins to support all versions.

Related issue(s)
#236

@smoya smoya force-pushed the feat/allowVersionsSchemaStore branch from f02907b to 302371a Compare July 6, 2022 14:16
@smoya
Copy link
Member Author

smoya commented Jul 6, 2022

After a private conversation with @magicmatatjahu, he suggested me a simplest version of the schema:

{
  "$id": "http://asyncapi.com/schema-store/all.schema-store.json",
  "$schema": "http://json-schema.org/draft-07/schema",
  "title": "JSON Schema documents for all AsyncAPI spec versions",
  "description": "All AsyncAPI JSON Schema documents listed in one file. Needed for serving all documents through schemastore.org",
  "type": "object",
  "oneOf": [
    {
      "$ref": "http://asyncapi.com/schema-store/1.0.0.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/1.1.0.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/1.2.0.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/2.0.0-rc1.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/2.0.0-rc2.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/2.0.0.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/2.1.0.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/2.2.0.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/2.3.0.json"
    },
    {
      "$ref": "http://asyncapi.com/schema-store/2.4.0.json"
    }
  ]
}

However, as he pointed out, schemas like http://asyncapi.com/definitions/1.1.0.json have the following enum on asyncapi property:

"asyncapi": {
            "type": "string",
            "enum": [
                "1.0.0",
                "1.1.0"
            ],
            "description": "The AsyncAPI specification version of this document."
        },

So it definitely won't work. We should keep the solution I'm adding in this PR.

schemas/all.schema-store.json Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@smoya smoya requested review from jonaslagoni and derberg July 7, 2022 10:03
@smoya smoya force-pushed the feat/allowVersionsSchemaStore branch from 882a839 to b86b976 Compare July 7, 2022 10:04
@sonarcloud
Copy link

sonarcloud bot commented Jul 7, 2022

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
0.0% 0.0% Duplication

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.

@smoya
Copy link
Member Author

smoya commented Jul 12, 2022

@dalelane whenever you have a chance, I need your +1 to merge this and move forward with the PR I should open on JSON Schema Store. Thank you!

@smoya
Copy link
Member Author

smoya commented Jul 13, 2022

/rtm

@asyncapi-bot asyncapi-bot merged commit 482cbfd into asyncapi:master Jul 13, 2022
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 3.1.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[JSON Schema Store] IDEs cannot determine the version of the JSON Schema to use
6 participants