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

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

Open
2 tasks done
jaimergp opened this issue Nov 24, 2024 · 0 comments · May be fixed by #283
Open
2 tasks done

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

jaimergp opened this issue Nov 24, 2024 · 0 comments · May be fixed by #283
Labels
type::bug describes erroneous operation, use severity::* to classify the type

Comments

@jaimergp
Copy link
Contributor

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

@jaimergp jaimergp added the type::bug describes erroneous operation, use severity::* to classify the type label Nov 24, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in 🧭 Planning Nov 24, 2024
@jaimergp jaimergp linked a pull request Nov 25, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

1 participant