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

Aperta Adatta ai principianti
#60,103 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
json
Ambito
tooling

Direzione di ricerca

L’issue identifica la copia di SchemaStore in src/schemas/json/codex-hooks.json e il documento di test in src/test/codex-hooks/hooks.json; esamina prima come sono cambiati lo schema radice e il documento di test nel commit 9497fde91. Riproduci poi la validazione segnalata con Python jsonschema o Ajv e conferma che lo schema aggiornato accetta un documento contenente $schema e hooks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
Rust
Stelle
133k
Fork
21.1k
Merge medio
1m
PR unite (30g)
997

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openai/codex

Tutte le issue di openai/codex

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.