eclipsesource / eclipsesource/jsonforms

Unify path handling

Offen
#2,153 0 Kommentare 0 Reaktionen 1 zugewiesene Person Zugewiesen an @lucas-koehler Auf GitHub ansehen
effort/high
Vorherrschende Sprache
TypeScript
Sterne
2.7k
Forks
424
Ø Merge
17 T. 8 Std.
Gemergte PRs (30 T.)
1

Beschreibung

At the moment we maintain two different paths in JSON Forms:
- The `scope` JSON Pointer paths used in UI Schema to resolve to subschemas of the handed over JSON Schema
- The dot-separated `path` paths (lodash format) to resolve to entries in the form-wide `data` object

The JSON Pointers are well defined and JSON Forms support escaping of their special characters (`/` and `~`).
The dot-separated `path`s however don't support escaping, leading to errors when a `.` is contained within the path. This was already reported in #1631 and #1849

To fix the issues and to harmonize path handling in JSON Forms we should settle on JSON Pointers for all paths. As a consequence data paths would change from `person.name` to `/person/name`.

Benefits:
- Well defined path format for which we already support escaping
- By keeping the data path as a string (in contrary to changing it to an array) we preserve memoization in the application frameworks (especially React, Vue).
- No more converting between paths, for example can be easily compared to AJV's JSON Pointers

Downside:
- Breaks custom code which manually modified or created paths

Therefore it should be released only with a 4.0 version and be mentioned in the MIGRATION guide.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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