andymatuschak / orbit

Experimental spaced repetition platform for exploring ideas in memory augmentation and programmable attention
https://withorbit.com
Other
1.71k stars 54 forks source link

ajv validation is incorrectly permitting extra properties on Events #236

Closed andymatuschak closed 3 years ago

andymatuschak commented 3 years ago

See test in events.test.ts: "[PATCH] validation/it fails when extra properties are provided".

In this test, we modify an incoming Event by adding an extra property. The API should 400, but instead it succeeds.

The JSON schema looks correct as far as I can tell: definitions/TaskIngestEvent does indeed include additionalProperties: false. The input fails to validate as expected in this online sandbox.

This may be an AJV bug; I'm not sure.

andymatuschak commented 3 years ago

@kirkbyo, would you mind taking a look at this? Hoping you might see some obvious issue.