Skip to content

Add top-level schema fields#82

Open
bollwyvl wants to merge 1 commit into
prefix-dev:mainfrom
bollwyvl:gh-29-add-dollar-schema
Open

Add top-level schema fields#82
bollwyvl wants to merge 1 commit into
prefix-dev:mainfrom
bollwyvl:gh-29-add-dollar-schema

Conversation

@bollwyvl

@bollwyvl bollwyvl commented Jul 8, 2026

Copy link
Copy Markdown

References

Changes

  • add top-level schema fields
    • $id
    • $schema to declare Draft 7
    • title
    • oneOf
      • change the top-level anyOf to the more accurate oneOf
    • $defs/*Recipe/properties/$schema
  • update tests

Motivation

Over two years since the initial PR, yaml-language-server has added support for locating schema from inline $schema instead of #yadda-yadda: $schema or # $schema (used by some other tools). This would allow for more precise and machine-readable identification.

Future Work

  • Publish the schema somewhere versioned
    • my recommendation would be ReadTheDocs, as versions, and the per-PR preview site are far easier to review vs "you get exactly one" of GitHub pages
  • Encourage downstream tools like conda-recipe-manager to populate the $schema: field

@bollwyvl
bollwyvl marked this pull request as ready for review July 8, 2026 16:05

@Hofer-Julian Hofer-Julian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@Hofer-Julian

Copy link
Copy Markdown
Contributor

If CI is fine, let's merge it. Please ping me if I forget

@bollwyvl

bollwyvl commented Jul 9, 2026

Copy link
Copy Markdown
Author

Of note, rattler-builder won't yet parse this:

Error:   × Failed to parse recipe
  ╰─▶ invalid value for 'recipe': unknown top-level field '$schema'
   ╭─[/home/conda/recipe_root/recipe.yaml:1:1]
 1 │ $schema: https://raw.githubusercontent.com/bollwyvl/recipe-format/992602280c73642fece6daf865c9774e7bb92e62/schema.json
   · ───┬───
   ·    ╰── invalid value for 'recipe': unknown top-level field '$schema'
 2 │ schema_version: 1
   ╰────
  help: valid top-level fields are: package, build, about, requirements, extra, source, tests, schema_version, context

@bollwyvl

bollwyvl commented Jul 9, 2026

Copy link
Copy Markdown
Author

Started prefix-dev/rattler-build#2645

@bollwyvl

Copy link
Copy Markdown
Author

Modulo some further changes, this is probably ready. Not sure the order of operations for linked PRs.

@bollwyvl
bollwyvl requested a review from Hofer-Julian July 10, 2026 13:55
@Hofer-Julian

Copy link
Copy Markdown
Contributor

Modulo some further changes, this is probably ready. Not sure the order of operations for linked PRs.

I guess we can bring it in?
The schema would be superset of what rattler-build allows, which sounds fine to me

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

Successfully merging this pull request may close these issues.

2 participants