Use `greenery` and `regex_transformer` to merge `pattern` and `patternProperties` keywords

Offen
#85 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
20/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
testing-qa

Rechercherichtung

Start by reading the existing handling of overlapping pattern and patternProperties expressions in the repository, then review the greenery and regex_transformer projects linked in the issue. The issue describes integrating their regex operations while handling unsupported syntax and Unicode performance; done means overlapping patterns can be combined where supported, with graceful fallback for unsupported cases. No code entry point or tests are named, and the issue has had no comment for years.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Currently, hypothesis-jsonschema basically just gives up if the schema has two overlapping regular expressions - at best, we'll try to randomly pick one to generate examples from, and use the other to filter. The status quo is mostly fine, but we can do better!

(Not all "python regular expressions" are truly regular in the sense of being equivalent to finite automata. Also, JSONSchema regex actually follow ECMA262 syntax, which is neither truly regular nor entirely compatible with the Python syntax. Fortunately the recommended subset is both compatible (except for Python allowing a trailing newline with $) and - with some special handling for lookahead - regular, so we'll continue our approach of handling what we can and gracefully degrading on the rest.)

This is a medium-to-large feature to develop, since regex_transformer exists but isn't packaged or particularly mature, and of unknown (neg-medium to medium) benefit. greenery might also need some patches to make Unicode handling more efficient. However I'd also like better regex handling in upstream Hypothesis, and it should only get easier over time!

Vorherrschende Sprache
Python
Sterne
281
Forks
35
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python-jsonschema/hypothesis-jsonschema

Alle Issues in python-jsonschema/hypothesis-jsonschema

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.