typebox-validators icon indicating copy to clipboard operation
typebox-validators copied to clipboard

TS2345: Argument of type 'TObject<{ handle: TString; count: TInteger; }>' is not assignable to parameter of type 'TSchema'.<br/>Property '[Kind]' is missing in type 'TObject<{ handle: TString; count: TInteger; }>' but required in type 'TSchema'.

Open jinusean opened this issue 1 year ago • 1 comments

Getting this type error while following the example StandardValidator

const schema = Type.Object({
	handle: Type.String({
		minLength: 5,
		maxLength: 10,
		pattern: '^[a-zA-Z]+$',
		errorMessage: 'must be a string of 5 to 10 letters',
	}),
	count: Type.Integer({ minimum: 0 }),
})

const validator = new StandardValidator(schema)

My understanding is kind is only necessary for Union types?

jinusean avatar Jan 29 '25 09:01 jinusean

Sorry, I've been unable to keep up with the breaking changes in TypeBox and do not plan to provide further support for this repo.

jtlapp avatar Jan 30 '25 04:01 jtlapp