enabling format-assertion via adding vocabulary to a new meta-schema (dialect?)
Maintainer antworten meist innerhalb von 6 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginne damit, den im Issue verlinkten CSAF-Schema-Fall zu reproduzieren, einschließlich Resource(contents=schema, specification=jsonschema.DRAFT202012) und Draft202012Validator.FORMAT_CHECKER. Lies die referenzierte meta_json_schema.json und die Diskussion rund um pull request 962; abgeschlossen ist die Aufgabe, wenn die unterstützte öffentliche API und das erwartete Verhalten der Formatassertion für ein benutzerdefiniertes Dialekt klar festgelegt oder dokumentiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 5k
- Forks
- 718
- Ø Merge
- 5 T. 9 Std.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python-jsonschema/jsonschema
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
python-jsonschema/jsonschema#1588 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Iterator error contexts lose parent links and absolute pathsEvtl. wieder frei @DawnofGenX hat das vor 31 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
python-jsonschema/jsonschema#1584 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 6 Tagen
-
regex format checker crashes with RecursionError on deeply nested patternsEvtl. vergeben @DawnofGenX hat das vor 31 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
python-jsonschema/jsonschema#1538 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 6 Tagen
-
is_duration raises an uncaught decimal.Overflow on a duration with a large exponentEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. OffenNeeds Test Upstream
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
python-jsonschema/jsonschema#1511 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
python-jsonschema/jsonschema#1597 ·
Maintainer antworten meist innerhalb von 6 Tagen
Alle Issues in python-jsonschema/jsonschema
Ähnliche Issues
-
community enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Hochfrequenz/sapgui.mcp#1039 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
didi/helixharness#18 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
dataforgoodfr/democracy-watch#46 · 1 Reaktion ·