Skip to content

Commit

Permalink
Reapply change
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieKolb committed Dec 20, 2024
1 parent 7b5b93f commit 2d4b5f1
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@ const validateResourceMapperValue = (
};
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (schemaEntry?.type) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const validationResult = validateFieldType(key, resolvedValue, schemaEntry.type, {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
valueOptions: schemaEntry.options,
strict: !resourceMapperField.attemptToConvertTypes,
parseStrings: !!resourceMapperField.convertFieldsToString,
});

if (!validationResult.valid) {
return { ...validationResult, fieldName: key };
if (!resourceMapperField.ignoreTypeMismatchErrors) {
return { ...validationResult, fieldName: key };
} else {
paramValues[key] = resolvedValue;
}
} else {
// If it's valid, set the casted value
paramValues[key] = validationResult.newValue;
Expand Down

0 comments on commit 2d4b5f1

Please sign in to comment.