`<=`, `>=` and `>` give wrong results for missing values and for booleans

Offen
#45 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
go
Bereich
backend

Rechercherichtung

Start by reading the comparison handling for <=, >=, and > and the tests for JSONPath filters; the issue does not name file paths, so locate those entry points in the Go repository. Check the missing-value and boolean cases against the RFC and jsonpath-rfc9535 results described here. Done means the two examples return [{}] and [] respectively, with regression tests covering both.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Two comparison cases come out wrong:

  • $[[email protected] <= @.b] on [{}] returns []. Both sides are missing, and missing equals missing, so <= should hold and
    it should return [{}]. >= has the same problem.
  • $[?true > false] on [1] returns [1]. Booleans aren't ordered by <, and true isn't equal to false, so >
    should be false and it should return [].

The RFC defines <= as "less-than or equal", with < defined only for two numbers or two strings, and equality of two
missing values being true. jsonpath-rfc9535 gives the expected results on both.

Vorherrschende Sprache
Go
Sterne
41
Forks
4
Ø Merge
2 T. 8 Std.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

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 theory/jsonpath

Alle Issues in theory/jsonpath

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

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