Class JsonSchemaValidationWorkflowRunner<T extends com.google.protobuf.MessageOrBuilder>
java.lang.Object
org.phenopackets.phenopackettools.validator.jsonschema.JsonSchemaValidationWorkflowRunner<T>
- Type Parameters:
T- must be one of the three top-level elements of the Phenopacket schema:PhenopacketOrBuilder,FamilyOrBuilder, orCohortOrBuilder.
- All Implemented Interfaces:
ValidationWorkflowRunner<T>
public class JsonSchemaValidationWorkflowRunner<T extends com.google.protobuf.MessageOrBuilder>
extends Object
implements ValidationWorkflowRunner<T>
Validates if given top-level element satisfies the following criteria:
- data format requirements - for instance if the element is a valid JSON document if JSON input is provided
- basic Phenopacket schema syntax requirements - the requirements described by the reference documentation.
Absence of a required field is an
ValidationLevel.ERRORand absence of a recommended field is aValidationLevel.WARNING, - custom syntax requirements - requirements provided in a JSON schema document(s) provided by the user,
- syntax requirements - requirements checked by the provided ad hoc
PhenopacketValidators, - semantic requirements - requirements checked by the provided
PhenopacketValidators.
The validation is performed in the order as outlined above. Note that the data format validation must pass in order for the latter steps to run.
Use one of JsonSchemaValidationWorkflowRunnerBuilders provided via static constructors (e.g. phenopacketBuilder()) to build
the validation workflow.
-
Method Summary
Modifier and TypeMethodDescriptionstatic JsonSchemaValidationWorkflowRunnerBuilder<org.phenopackets.schema.v2.CohortOrBuilder>static JsonSchemaValidationWorkflowRunnerBuilder<org.phenopackets.schema.v2.FamilyOrBuilder>static JsonSchemaValidationWorkflowRunnerBuilder<org.phenopackets.schema.v2.PhenopacketOrBuilder>validate(byte[] payload) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.phenopackets.phenopackettools.validator.core.ValidationWorkflowRunner
validate, validate
-
Method Details
-
phenopacketBuilder
public static JsonSchemaValidationWorkflowRunnerBuilder<org.phenopackets.schema.v2.PhenopacketOrBuilder> phenopacketBuilder()- Returns:
- a
JsonSchemaValidationWorkflowRunnerBuilderfor building aJsonSchemaValidationWorkflowRunnerfor validatingPhenopacketOrBuilder.
-
familyBuilder
public static JsonSchemaValidationWorkflowRunnerBuilder<org.phenopackets.schema.v2.FamilyOrBuilder> familyBuilder()- Returns:
- a
JsonSchemaValidationWorkflowRunnerBuilderfor building aJsonSchemaValidationWorkflowRunnerfor validatingFamilyOrBuilder.
-
cohortBuilder
public static JsonSchemaValidationWorkflowRunnerBuilder<org.phenopackets.schema.v2.CohortOrBuilder> cohortBuilder()- Returns:
- a
JsonSchemaValidationWorkflowRunnerBuilderfor building aJsonSchemaValidationWorkflowRunnerfor validatingCohortOrBuilder
-
validators
- Specified by:
validatorsin interfaceValidationWorkflowRunner<T extends com.google.protobuf.MessageOrBuilder>
-
validate
- Specified by:
validatein interfaceValidationWorkflowRunner<T extends com.google.protobuf.MessageOrBuilder>
-
validate
- Specified by:
validatein interfaceValidationWorkflowRunner<T extends com.google.protobuf.MessageOrBuilder>
-
validate
- Specified by:
validatein interfaceValidationWorkflowRunner<T extends com.google.protobuf.MessageOrBuilder>
-