-
-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
TypeScript fails to compile the following snippet:
import createValidator = require('is-my-json-valid');
const schema = {
type: 'object',
properties: {
name: { type: 'string' },
age: { type: 'number' },
},
required: [
'name'
]
};
createValidator(schema);showing the following error:
[ts]
Argument of type '{ type: string; properties: { name: { type: string; }; age: { type: string; }; }; required: string[]; }' is not assignable to parameter of type 'AnySchema'.
Type '{ type: string; properties: { name: { type: string; }; age: { type: string; }; }; required: string[]; }' is not assignable to type 'AnyOneOfSchema'.
Property 'oneOf' is missing in type '{ type: string; properties: { name: { type: string; }; age: { type: string; }; }; required: string[]; }'.
jwasnoggin
Metadata
Metadata
Assignees
Labels
No labels