-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Remove root level nested params #20172
Conversation
Co-authored-by: Jean-Sébastien Herbaux <Convly@users.noreply.github.com>
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.
Would it be possible to add unit tests to the convert-query-params? Dow e already have some?
yeah, there are some not a lot, there are also some test.todos, so I could attempt to create those test cases |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Would be awesome! |
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.
You'll also need to remove the support for the deprecated syntax in the query-populate DZ handler.
https://github.com/strapi/strapi/blob/v5/main/packages/core/utils/src/traverse/query-populate.ts
// Handle legacy DZ params
let newProperties: unknown = omit('on', value);
for (const componentUID of components) {
const componentSchema = getModel(componentUID);
const properties = await recurse(
visitor,
{ schema: componentSchema, path, getModel },
value
);
newProperties = merge(newProperties, properties);
}
Object.assign(newValue, newProperties);
…om/strapi/strapi into v5/remove-root-level-nested-params
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.
Reviewed and nothing to add on the code that hasn't already been said.
There's a linting error, and it looks like some API tests need to be updated maybe because they were using the deprecated format.
Co-authored-by: Jean-Sébastien Herbaux <Convly@users.noreply.github.com>
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.
Seems like we still have an issue with populate: '*'
https://github.com/strapi/strapi/actions/runs/9189884447/job/25273258553?pr=20172
Co-authored-by: Jean-Sébastien Herbaux <Convly@users.noreply.github.com>
Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu>
What does it do?
It makes sure that only Fragments can be used with morph data structures,
updating the types and throwing errors incase the type checks were bypassed
How to test it?
This is an example on how things should work based on the getstarted app
if you try to pass unsupported nested params to Dynamic Zone for example, typescript should show an error.
if typescript was ignored a clear error should be thrown