Class JsonSchemaBeforeWriteChecker

java.lang.Object
org.restheart.mongodb.interceptors.JsonSchemaBeforeWriteChecker
All Implemented Interfaces:
ConfigurablePlugin, ExchangeTypeResolver<MongoRequest,MongoResponse>, Interceptor<MongoRequest,MongoResponse>, MongoInterceptor, Plugin
Direct Known Subclasses:
JsonSchemaAfterWriteChecker

public class JsonSchemaBeforeWriteChecker extends Object implements MongoInterceptor
Checks documents according to the specified JSON schema This intercetor is able to check PUT and POST requests that don't use update operators. PATCH requests are checked by jsonSchemaAfterWrite

Note that checking bulk PATCH, i.e. PATCH /coll/*, is not supported. In this case the optional metadata property 'skipNotSuppored' controls the behaviour: if true, the request is not checked and executed, if false the request fails. It checks the request content against the JSON schema specified by the 'jsonSchema' collection metadata:

{ "jsonSchema": { "schemaId": <schemaId> "schemaStoreDb": <schemaStoreDb>, "skipNotSupported": <boolean> } }

schemaStoreDb is optional, default value is same db, skipNotSuppored is optional, defaul value is false
Author:
Andrea Di Cesare <andrea@softinstigate.com>