diff --git a/types/revalidator/index.d.ts b/types/revalidator/index.d.ts index ec172c2be2..1021e1d653 100644 --- a/types/revalidator/index.d.ts +++ b/types/revalidator/index.d.ts @@ -36,7 +36,9 @@ declare module Revalidator { } interface JSONSchema { + type?: 'object'; properties?: ISchemas; + patternProperties?: ISchemas; } interface ISchemas { diff --git a/types/revalidator/revalidator-tests.ts b/types/revalidator/revalidator-tests.ts index d087d19571..0aea1968bf 100644 --- a/types/revalidator/revalidator-tests.ts +++ b/types/revalidator/revalidator-tests.ts @@ -35,12 +35,7 @@ revalidator.validate(someObject, { properties: { title: { type: 'string', - maxLength: 140, - conditions: { - optional: function () { - return !this.published; - } - } + maxLength: 140 }, date: { type: 'string', format: 'date', messages: { format: "must be a valid %{expected} and nothing else" } }, body: { type: 'string' },