fix(schema): allow $schema keyword at root of hooks.json

Open Beginner friendly
#60,103 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
json
Domain
tooling

Research direction

The issue identifies SchemaStore’s copy at src/schemas/json/codex-hooks.json and the test document at src/test/codex-hooks/hooks.json; first inspect how the root schema and test document changed in commit 9497fde91. Reproduce the reported validation with Python jsonschema or Ajv, then confirm a document containing $schema and hooks is accepted by the updated schema.

Written by the indexing model from the issue text.

Description

bug config hooks

The SchemaStore copy of the Codex hooks schema (what editors validate hooks.json against) changed on 2026-06-16 in SchemaStore commit 9497fde91 ("Tighten Codex hooks root schema"): the document root gained additionalProperties: false, with hooks as the only allowed key. Any hooks.json that carries a $schema key, which editor users add to get validation in the first place, or a description, is now rejected at the root.

This is confirmed by two validators, Python jsonschema 4.26 and Ajv 8, on SchemaStore's own test document for the schema (src/test/codex-hooks/hooks.json), valid before that commit and rejected after. The test document was edited in the same commit, which is why SchemaStore's CI stayed green.

To reproduce in a clone of SchemaStore/schemastore:

git show 9497fde91^:src/schemas/json/codex-hooks.json > before.json
git show 9497fde91:src/schemas/json/codex-hooks.json > after.json
python3 -c "import json,jsonschema as j; i={'\$schema':'https://json.schemastore.org/codex-hooks.json','hooks':{}}; v=lambda p: j.validators.validator_for(s:=json.load(open(p)))(s).is_valid(i); print(v('before.json'), v('after.json'))"
# True False

If closing the root was intended, allowing $schema explicitly would keep editor users' files valid. If the schema source lives in this repository, the check that found this runs as a GitHub Action on every change to it and reports exactly this kind of document, with no effect on merges unless you want one: https://github.com/Ramesh-35/invar (judge_contracts and judge_tests inputs).

Dominant language
Rust
Stars
133k
Forks
21.1k
Avg merge
1m
Merged PRs (30d)
995

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.