public class SchemaValidator extends Object
ResourceType-definitions that define a resource endpoint with the setup of their
resources. Meaning that a ResourceType knows the meta-schemata of a resource and its extensions
which is why the ResourceType is the base of validating a resource-document| Modifier and Type | Class and Description |
|---|---|
protected static class |
SchemaValidator.DirectionType
the direction type is used for validation.
|
| Modifier and Type | Method and Description |
|---|---|
static com.fasterxml.jackson.databind.JsonNode |
validateDocumentForRequest(ResourceType resourceType,
com.fasterxml.jackson.databind.JsonNode document,
HttpMethod httpMethod)
will validate an incoming document against its main schema and all its extensions.
|
protected static com.fasterxml.jackson.databind.JsonNode |
validateDocumentForRequest(Schema metaSchema,
com.fasterxml.jackson.databind.JsonNode document,
HttpMethod httpMethod)
will validate an incoming document against its main schema and all its extensions.
|
static com.fasterxml.jackson.databind.JsonNode |
validateDocumentForResponse(ResourceTypeFactory resourceTypeFactory,
ResourceType resourceType,
com.fasterxml.jackson.databind.JsonNode document,
com.fasterxml.jackson.databind.JsonNode validatedRequest,
String attributes,
String excludedAttributes)
will validate an outgoing document against its main schema and all its extensions.
|
protected static com.fasterxml.jackson.databind.JsonNode |
validateDocumentForResponse(Schema metaSchema,
com.fasterxml.jackson.databind.JsonNode document)
will validate an outgoing document against its main schema and all its extensions.
|
protected static com.fasterxml.jackson.databind.JsonNode |
validateDocumentForResponse(Schema metaSchema,
com.fasterxml.jackson.databind.JsonNode document,
com.fasterxml.jackson.databind.JsonNode validatedRequest,
String attributes,
String excludedAttributes)
will validate an outgoing document against its main schema and all its extensions.
|
protected static com.fasterxml.jackson.databind.JsonNode |
validateExtensionForRequest(Schema metaSchema,
com.fasterxml.jackson.databind.JsonNode document,
HttpMethod httpMethod)
This method is explicitly for extension validation.
|
static com.fasterxml.jackson.databind.JsonNode |
validateSchemaDocument(Schema metaSchema,
com.fasterxml.jackson.databind.JsonNode schemaDocument)
this method will validate a new schema declaration against a meta schema.
|
static com.fasterxml.jackson.databind.JsonNode |
validateSchemaDocumentForRequest(Schema metaSchema,
com.fasterxml.jackson.databind.JsonNode schemaDocument)
this method will validate a new schema declaration against a meta schema.
|
public static com.fasterxml.jackson.databind.JsonNode validateSchemaDocument(Schema metaSchema, com.fasterxml.jackson.databind.JsonNode schemaDocument)
metaSchema - the meta schema that is used to validate the new schemaschemaDocument - the new schema document that should be validatedpublic static com.fasterxml.jackson.databind.JsonNode validateSchemaDocumentForRequest(Schema metaSchema, com.fasterxml.jackson.databind.JsonNode schemaDocument)
metaSchema - the meta schema that is used to validate the new schemaschemaDocument - the new schema document that should be validatedpublic static com.fasterxml.jackson.databind.JsonNode validateDocumentForResponse(ResourceTypeFactory resourceTypeFactory, ResourceType resourceType, com.fasterxml.jackson.databind.JsonNode document, com.fasterxml.jackson.databind.JsonNode validatedRequest, String attributes, String excludedAttributes) throws DocumentValidationException
Mutability.WRITE_ONLY or a returned value of Returned.NEVER. This will prevent the server
from accidentally returning passwords or equally sensitive informationresourceType - the resource type definition of the incoming documentdocument - the document that should be validatedvalidatedRequest - this parameter is used for attributes that have a returned value of
Returned.REQUEST. Those attributes should only be returned if the attribute was modified
on a POST, PUT or PATCH request or in a query request only if the attribute is present within the
attributes parameter. So the validated request tells us if the client tried to write to
the attribute and if this is the case the attribute should be returnedattributes - When specified, the default list of attributes SHALL be overridden, and each resource
returned MUST contain the minimum set of resource attributes and any attributes or sub-attributes
explicitly requested by the "attributes" parameter. The query parameter attributes value is a
comma-separated list of resource attribute names in standard attribute notation (Section 3.10)
form (e.g., userName, name, emails).excludedAttributes - When specified, each resource returned MUST contain the minimum set of resource
attributes. Additionally, the default set of attributes minus those attributes listed in
"excludedAttributes" is returned. The query parameter attributes value is a comma-separated list
of resource attribute names in standard attribute notation (Section 3.10) form (e.g., userName,
name, emails).ScimNodesDocumentValidationException - if the schema validation failedprotected static com.fasterxml.jackson.databind.JsonNode validateDocumentForResponse(Schema metaSchema, com.fasterxml.jackson.databind.JsonNode document)
Mutability.WRITE_ONLY or a returned value of Returned.NEVER. This will prevent the server
from accidentally returning passwords or equally sensitive informationmetaSchema - the json meta schema definition of the documentdocument - the document to validateScimNodesprotected static com.fasterxml.jackson.databind.JsonNode validateDocumentForResponse(Schema metaSchema, com.fasterxml.jackson.databind.JsonNode document, com.fasterxml.jackson.databind.JsonNode validatedRequest, String attributes, String excludedAttributes)
Mutability.WRITE_ONLY or a returned value of Returned.NEVER. This will prevent the server
from accidentally returning passwords or equally sensitive informationmetaSchema - the json meta schema definition of the documentdocument - the document to validatevalidatedRequest - this parameter is used for attributes that have a returned value of
Returned.REQUEST. Those attributes should only be returned if the attribute was modified
on a POST, PUT or PATCH request or in a query request only if the attribute is present within the
attributes parameter. So the validated request tells us if the client tried to write to
the attribute and if this is the case the attribute should be returned write to the attribute and
if this is the case the attribute should be returnedattributes - When specified, the default list of attributes SHALL be overridden, and each resource
returned MUST contain the minimum set of resource attributes and any attributes or sub-attributes
explicitly requested by the "attributes" parameter. The query parameter attributes value is a
comma-separated list of resource attribute names in standard attribute notation (Section 3.10)
form (e.g., userName, name, emails).excludedAttributes - When specified, each resource returned MUST contain the minimum set of resource
attributes. Additionally, the default set of attributes minus those attributes listed in
"excludedAttributes" is returned. The query parameter attributes value is a comma-separated list
of resource attribute names in standard attribute notation (Section 3.10) form (e.g., userName,
name, emails).ScimNodespublic static com.fasterxml.jackson.databind.JsonNode validateDocumentForRequest(ResourceType resourceType, com.fasterxml.jackson.databind.JsonNode document, HttpMethod httpMethod) throws DocumentValidationException
Mutability.READ_ONLY. The client is not able to write these attributes and therefore the server
does not need to process them.resourceType - the resource type definition of the incoming documentdocument - the document that should be validatedhttpMethod - the request http method that is used to validate the request-documentScimNodesDocumentValidationException - if the schema validation failedprotected static com.fasterxml.jackson.databind.JsonNode validateDocumentForRequest(Schema metaSchema, com.fasterxml.jackson.databind.JsonNode document, HttpMethod httpMethod)
Mutability.READ_ONLY. The client is not able to write these attributes and therefore the server
does not need to process them.metaSchema - the json meta schema definition of the documentdocument - the document to validatehttpMethod - tells us which request type the client has used. This is e.g. necessary for immutable
types that are valid on POST requests but invalid on PUT requestsScimNodesprotected static com.fasterxml.jackson.databind.JsonNode validateExtensionForRequest(Schema metaSchema, com.fasterxml.jackson.databind.JsonNode document, HttpMethod httpMethod)
metaSchema - the json meta schema definition of the documentdocument - the extension to validatehttpMethod - tells us which request type the client has used. This is e.g. necessary for immutable
types that are valid on POST requests but invalid on PUT requestsScimNodesCopyright © 2019. All rights reserved.