Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a hotfix release that fixes #3527.
This master->feature merge commit that I made yesterday when merging #3509 contained a subtle error.
What happened
In
ObjectModel, we destructure props at the top ofrender(), like we do in many components:There's two things going on here: we're grabbing some props from
this.propsthat we want and adding them to the local scope, and storing the rest of the props inpropswith destructuring rest syntax.In the merge commit linked above, I added
specSelectorsto the destructuring statement, to support the object model anyOf/oneOf/not changes from #3513. Here's the props destructuring statement after the merge:Further down in the same render function, we pass
propsto child components (which end up being the right-hand side of the Model display, seen broken in the issue linked above):We're spreading our
propsobject onto the child component with{ ...props }.Unfortunately, my merge commit that added
specSelectorsto the props destructuring statement (for use in theObjectModelscope) had the side effect of removingspecSelectorsfrom thepropsobject used here. This resulted inModelhaving nospecSelectorsprop, which it needs to work properly, especially with the OAS3 deprecated parameter support introduced this week in #3458.There was no linter or test indication that something had gone wrong. I know this is a bit of a "perfect storm" situation, but this practice of using "rest of props" is fragile.
I propose we end use of rest syntax in props destructuring by implementing an ESLint rule. Instead, we should be verbose by creating objects specifically for use in spreading onto child props, or simply passing in each prop explicitly to the child.
P.S.: It's worth noting that #3265 would have saved us from shipping this.