Class MetaSchemaValidator
java.lang.Object
de.captaingoldfish.scim.sdk.server.schemas.validation.AbstractSchemaValidator
de.captaingoldfish.scim.sdk.server.schemas.validation.MetaSchemaValidator
- Since:
- 24.04.2021
- Author:
- Pascal Knueppel
-
Field Summary
Fields inherited from class de.captaingoldfish.scim.sdk.server.schemas.validation.AbstractSchemaValidator
resourceNodeType -
Method Summary
Modifier and TypeMethodDescriptionprotected intthe http status code to use in theDocumentValidationExceptionif the validation fails.static MetaSchemaValidatorprotected Optional<com.fasterxml.jackson.databind.JsonNode>validateAttribute(SchemaAttribute schemaAttribute, com.fasterxml.jackson.databind.JsonNode attribute) the concrete attribute validation that is differs by the context in which the attribute is validatedvalidateDocument(Schema schema, com.fasterxml.jackson.databind.JsonNode resource) validates the document and additionally adds the schemas-attribute to the validated document.Methods inherited from class de.captaingoldfish.scim.sdk.server.schemas.validation.AbstractSchemaValidator
checkDocumentAndMetaSchemaRelationship, getAttributeExtractor, validateDocument
-
Method Details
-
getInstance
- Returns:
- the singleton instance to validate documents like resourceTypes, resourceSchemas etc. against its meta schema definitions
-
validateDocument
public ScimObjectNode validateDocument(Schema schema, com.fasterxml.jackson.databind.JsonNode resource) validates the document and additionally adds the schemas-attribute to the validated document.- Overrides:
validateDocumentin classAbstractSchemaValidator- Parameters:
schema- the schemas definitionresource- the document that should be validated- Returns:
- the validated schema document
-
validateAttribute
protected Optional<com.fasterxml.jackson.databind.JsonNode> validateAttribute(SchemaAttribute schemaAttribute, com.fasterxml.jackson.databind.JsonNode attribute) the concrete attribute validation that is differs by the context in which the attribute is validated- Specified by:
validateAttributein classAbstractSchemaValidator- Parameters:
schemaAttribute- the definition of the attribute that must be validatedattribute- the attribute to validate- Returns:
- the validated attribute
-
getHttpStatusCode
protected int getHttpStatusCode()the http status code to use in theDocumentValidationExceptionif the validation fails. Should be 400 (bad request) for requests and 500 (internal server error) for responses- Specified by:
getHttpStatusCodein classAbstractSchemaValidator
-