Skip to content

Howto support different local schema versions #379

@vvmruder

Description

@vvmruder

Maybe I really miss some point here. But I have the following situation:

I locally store different versions of the same schema for a YAML in the way:

  • .../schema/master/service.schema.json
  • .../schema/1.0.5/service.schema.json
  • ...
  • .../schema/0.0.4/service.schema.json
  • ...

I then have several projects using this schemas. And it works well. Big THANK YOU for that.

But over time it happens that project-a's service.yml is of version 0.0.4 and project-b's service.yml is of version 1.0.5. To be able to clarify that, I have an attribute schema_version in my service.yml.

Problem now: Whenever I want vscode to validate against my schema in correct version I need to edit my configuration in the settings.json because there I define:

{
    "yaml.schemas": {
        "file:///.../schema/master/service.schema.json": [
            "service.yml"
        ]
    }
}

So my questions are:

  • Am I doing wrong here?
  • Is there a better way?
  • Maybe even to directly use information of version number from my service.yml via place holder in settings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions