-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify path handling to consistenly use JSON Pointer #2346
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
e68d3ef
to
484bec7
Compare
f20ee31
to
aef686f
Compare
aef686f
to
426da2c
Compare
426da2c
to
99a4590
Compare
- Rework Paths.compose to accept a JSON pointer and a variable number of unencoded segments to add - Add unit tests for Path.compose - Increase usage of Paths.compose across renderers - Remove obsolete leading slashes of segments - Allow handing in numbers (indices) to path composition - improve migration guide
99a4590
to
33d669b
Compare
@@ -28,7 +28,7 @@ export const getI18nKeyPrefixBySchema = ( | |||
*/ | |||
export const transformPathToI18nPrefix = (path: string): string => { | |||
return ( | |||
path | |||
toLodashPath(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First filter array segments, then convert to lodash path
|
||
if (isEmpty(segments)) { | ||
return path ?? ''; | ||
export const toLodashSegments = (jsonPointer: string): string[] => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename to remove the lodash part?
Unify path handling to use JSON Pointer as path format consistently. No longer use lodash paths (dot separated paths) to resolve data.
Besides unifying pointer usage, this reworks the
Paths.compose
util to accept one base json pointer and an arbitrary number of segments to append. These can also be number now that are automatically converted.closes #2153
supersedes #2168