ritchieanesco/json-schema-yup-transform

Yup 0.32.x support

caseyjhol opened this issue · 4 comments

Native Typescript support was added to Yup in v0.32.0. I think there might need to be some adjustments made to support this, as I ran into some errors when trying to extend a schema. This causes Yup to throw a validation error when typing in an input:

	const yupSchema = convertToYup(passwordSchema).concat(
		yup.object().shape({
			confirmNewPassword: yup
				.string()
				.equals(
					[yup.ref("newPassword")],
					"Both passwords must match."
				)
				.required(),
		})
	);

I think this has to do with the different Yup version json-schema-yup-transform uses.

@caseyjhol there is also breaking changes in how it applies conditional rules e.g. when which may require some major changes. From what i can see, everything still works fine up until 0.31.1.

➕ This library no longer plays well with current yup schemas when trying to concatenate (for example, if you build a base schema from your json-schema, but then need to add some additional validations to the schema programmatically).

@caseyjhol @brandonlenz 2.0.0-beta.0 has just been published that supports yup v0.32.11.

@caseyjhol @brandonlenz 2.0.0-beta.0 has just been published that supports yup v0.32.11.

Any plans for non beta release of 2.0.0 ?