kristianmandrup/schema-to-yup

Previously working required message, drops when combining refValueFor

Opened this issue · 1 comments

Working in version 1.12.13
Config:
{ "config": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "currentPassword": { "type": "string", "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])\\S{8,99}$" }, "newPassword": { "type": "string", "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])\\S{8,99}$" }, "confirm_password": { "type": "string", "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])\\S{8,99}$", "refValueFor": "newPassword" } }, "required": [ "currentPassword", "newPassword", "confirm_password" ] }, "errorMessages": { "currentPassword": { "required": "Enter your current password", "pattern": "Please enter a valid password" }, "newPassword": { "required": "Enter a new password", "pattern": "Please enter a valid password" }, "confirm_password": { "required": "Enter a confirm password", "pattern": "Please enter a valid password", "refValueFor": "Confirm password field must have the same value as New password" } } }

in versions above 1.12.13 confirm_password's required message, gets dropped and the following now appears: 'confirm_password is a required field'

I'm sorry about that. Not currently maintaining this project much and the test suite has not been kept up to date for a while.
You're welcome to have a look into it, the latest commits and make a PR if you spot the regression. Cheers.