Problem/Motivation
Such component may breaks:
name: Test
props:
type: object
properties:
foo:
type: object
properties:
id:
type: string
Because in ReferencesResolver service, we run recursively run justinrainbow resolver which
- is transforming every arrays to StdClass, included nested arrays
- add a
idproperty when a reference is solved to keep track of the resolution
And then we do some operations on this added id property, whcih fail when we are manipulating the prop named id instead.
Proposed resolution
- Minimal: alter the
idproperty only if a reference has been resolved - Better: run the justinrainbow resolver only there is a
$refproperty.
Issue fork ui_patterns-3612960
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pdureau commentedComment #5
pdureau commentedhi @yuraul feel free to assign the issue to you.
Comment #6
smovs commentedComment #9
smovs commentedHey @pdureau and team!
I pulled the latest 2.0.x branch and updated the approach a bit. Please review
Comment #10
pdureau commentedThanks a lot, i will have a look
Comment #11
pdureau commentedThat looks great, bu tI will also test it with #3352063: Allow schema references in Single Directory Component prop schemas before RTBC
Comment #12
pdureau commentedThis issue seems to not exist in the Core MR: #3352063: Allow schema references in Single Directory Component prop schemas.
So, the logic added here will be removed once we adopt the Core reference resolver in 2.1.x or 3.x releases. But we at least we will have the added tests to prevent any regression.
Comment #13
just_like_good_vibeshello :)
thanks for the nice work,
just before we go on with this MR, is-it possible to shrink the long comments please ? ( co-edited by Claude?)
thank you
Comment #14
smovs commentedHi!
Updated comments. Simplified and removed redundancy.
Yes, I used Claude (a really helpful tool)
Comment #16
just_like_good_vibeshello, i tried to rebase the work, but i finally created a second branch up to date with the last 2.0.x and integrated your work in it.
i opened https://git.drupalcode.org/project/ui_patterns/-/merge_requests/540
Comment #18
just_like_good_vibes