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

How to: $ref to external schemas in VSC #207

Open
jeremyfiel opened this issue Sep 26, 2023 · 0 comments
Open

How to: $ref to external schemas in VSC #207

jeremyfiel opened this issue Sep 26, 2023 · 0 comments

Comments

@jeremyfiel
Copy link
Contributor

Where would one register referenced schemas in VSC so they would be available to Intellisense?

I have a schema with multiple (possibly hundreds) of subschemas which I want to write a data instance against. How can I use VSC Intellisense to guide me through the schema while I'm creating an instance?

Take this concocted example:

{
    "id": "http://example.com/common/mainSchema.json",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "allOf": [
        {
            "type": "object",
            "properties": {
                "id": {
                    "$ref": "simpleIDType_v01.json#"
                }
            }
        },
        {
            "$ref": "anotherNestedSchema.json#"
        }
    ]
}
{
    "id": "http://example.com/common/simpleIDType_v01.json",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "string",
    "pattern": "^[a-zA-Z0-9]+$"
}
{
    "id": "http://example.com/common/anotherNestedSchema.json",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "properties": {
        "organizationId": {
            "$ref": "simpleIDType_v01.json#"
        }
    }
}
#instance 
{
"$schema": "http://example.com/common/mainSchema.json",
"id": "testing",
"   <<  I want Intellisense to provide the available properties in the `allOf/1` subschema (anotherNestedSchema). 
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

1 participant