enabling format-assertion via adding vocabulary to a new meta-schema (dialect?)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia riproducendo il caso di schema CSAF collegato nell’issue, incluso Resource(contents=schema, specification=jsonschema.DRAFT202012) e Draft202012Validator.FORMAT_CHECKER. Leggi il meta_json_schema.json di riferimento e la discussione relativa a pull request 962; il lavoro è completato quando l’API pubblica supportata e il comportamento previsto dell’asserzione sul formato per un dialetto personalizzato sono chiaramente definiti o documentati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What is the supported way to check a JSON file via a (local) schema that wants to enforce the format assertions?
It is already supported?
My example is what https://github.com/oasis-tcs/csaf/pull/962 is trying to do.
sets a custom dialect:
"$schema": "https://docs.oasis-open.org/csaf/csaf/v2.1/meta_json_schema.json",
which locally is
https://github.com/oasis-tcs/csaf/blob/78f4b61ba2ba05d375a452ef7938abde16949457/csaf_2.1/json_schema/meta_json_schema.json
and just aims for adding the necessary vocabulary to treat formats as assertion.
However as can be seen in https://github.com/oasis-tcs/csaf/pull/962#issuecomment-2841656817 and above, that is needs to explicitly set jsonschema.DRAFT202012 to just add the
resource = Resource(contents=schema, specification=jsonschema.DRAFT202012)
I haven't found a public API way to give the new dialect to the referencing.jsonschema._SPECIFICATIONS. (As we do not change the referencing behaviour, it may or not may be okay to use specification=jsonschema.DRAFT202012., it just feels not right as the meta schema is available.
The other concern is that adding the vocabularies does not seem to change assertion checking in the implementation, only adding format_checker=Draft202012Validator.FORMAT_CHECKER decides this. According to my (limited) understanding adding the vocabulary of format-assertion should enable the checks by default. Okay - Draft202012Validator is for the Draft 2020-12 where formation assertion is off by default, but can be enabled.
If it already works, then an example of how to create a new meta schema (dialect) that has format-assertion enable like it should be done in accordance with Draft 2020-12 would be very helpful.
- Lingua principale
- Python
- Stelle
- 5k
- Fork
- 694
- Merge medio
- 1g 15h
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-jsonschema/jsonschema
-
Iterator error contexts lose parent links and absolute pathsForse già presa @DawnofGenX l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
python-jsonschema/jsonschema#1584 · 3 commenti ·
-
regex format checker crashes with RecursionError on deeply nested patternsForse già presa @DawnofGenX l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-jsonschema/jsonschema#1538 · 1 commento ·
-
is_duration raises an uncaught decimal.Overflow on a duration with a large exponentForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaNeeds Test Upstream
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-jsonschema/jsonschema#1511 · 1 commento ·
-
regex format checker crashes with ValueError on conflicting inline flagsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
python-jsonschema/jsonschema#1558 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
python-jsonschema/jsonschema#1547 ·
Tutte le issue di python-jsonschema/jsonschema
Issue simili
-
request-theme
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 70/100
LizardByte/ThemerrDB#8877 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area/install-update comp/gateway P0 sweeper:risk-compatibility type/bug
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 72/100
NousResearch/hermes-agent#135997 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
deepset-ai/haystack#13199 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] JSONLoader rejects valid UTF-8 BOM filesForse già presa @zouyonghe l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
anthropics/knowledge-work-plugins#1298 ·
I maintainer di solito rispondono entro 1 giorno