Skip to content

$schema and $id are being used in the wrong way #282

@jaimergp

Description

@jaimergp

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

I think I got this wrong when I first designed the schema.

  • The menuinst JSON schema ITSELF should define a $schema key that points to the JSON Schema dialect.
  • Each shortcut should then set their $schema key so it points to the menuinst JSON schema corresponding to that version!

With examples:

Each shortcut is doing this weird thing:

{
    "$schema": "https://json-schema.org/draft-07/schema",
    "$id": "https://schemas.conda.io/menuinst-1.schema.json",
    "menu_name": "Example",
    ...
}

But a shortcut should look like this:

{
    "$schema": "https://schemas.conda.io/menuinst-1.schema.json",
    "menu_name": "Example",
    ...
}

Then https://schemas.conda.io/menuinst-1.schema.json itself should have this in the top-level:

{
  "$schema": "https://json-schema.org/draft-07/schema",
  "title": "MenuInstSchema",
  "description": "Metadata required to create menu items across operating systems with ``menuinst``.",
  "type": "object",
  "properties": {
    "$id": {
      "title": "$Id",
      "description": "Version of the menuinst schema.",
      "enum": [
        "https://schemas.conda.io/menuinst-1.schema.json"
      ],
      "type": "string"
    },
    "$schema": {
      "title": "$Schema",
      "description": "Standard of the JSON schema we adhere to.",
      "enum": [
        "https://json-schema.org/draft-07/schema"
      ],
      "type": "string"
    },
  ...
}

Conda Info

Conda Config

Conda list

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked[bot] locked due to inactivitytype::bugdescribes erroneous operation, use severity::* to classify the type

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions