Skip to content

Fix regression in how array input values are transformed #266

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

Merged
merged 2 commits into from
May 29, 2024

Conversation

mattt
Copy link
Contributor

@mattt mattt commented May 29, 2024

Resolves #265

#184 introduced a regression in how array input values are serializes.

if (Array.isArray(value)) {
let copy = [];
for (const val of value) {
copy = await transform(val, mapper);
}
return copy;
}

This PR fixes the logic to append transformed values to the array instead of copying them.

if (Array.isArray(value)) {
const copy = [];
for (const val of value) {
const transformed = await transform(val, mapper);
copy.push(transformed);
}
return copy;
}

@mattt mattt force-pushed the mattt/fix-files-regression branch from ae68faa to cfb8ff4 Compare May 29, 2024 17:56
@mattt mattt force-pushed the mattt/fix-files-regression branch from cfb8ff4 to ab69c56 Compare May 29, 2024 17:56
@mattt mattt merged commit d981fc1 into main May 29, 2024
18 checks passed
@mattt mattt deleted the mattt/fix-files-regression branch May 29, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API responds 422 when input contains string[]
1 participant