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 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 requirements - requirements provided in a JSON schema document(s) provided by the user.
- semantic requirements - requirements checked by
PhenopacketValidators provided by the user.
The validation is performed in steps as outlined by the list above. Note that the data format validation must pass in order for the latter steps to run.
Use one of JsonSchemaValidationWorkflowRunner.Builders provided via static constructors (e.g. phenopacketBuilder()) to build
the validation workflow.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classJsonSchemaValidationWorkflowRunner.Builder<T extends com.google.protobuf.MessageOrBuilder>A builder forJsonSchemaValidationWorkflowRunner. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonSchemaValidationWorkflowRunner.Builder<org.phenopackets.schema.v2.CohortOrBuilder>static JsonSchemaValidationWorkflowRunner.Builder<org.phenopackets.schema.v2.FamilyOrBuilder>static JsonSchemaValidationWorkflowRunner.Builder<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 JsonSchemaValidationWorkflowRunner.Builder<org.phenopackets.schema.v2.PhenopacketOrBuilder> phenopacketBuilder()- Returns:
- a
JsonSchemaValidationWorkflowRunner.Builderfor building aJsonSchemaValidationWorkflowRunnerfor validatingPhenopacketOrBuilder.
-
familyBuilder
public static JsonSchemaValidationWorkflowRunner.Builder<org.phenopackets.schema.v2.FamilyOrBuilder> familyBuilder()- Returns:
- a
JsonSchemaValidationWorkflowRunner.Builderfor building aJsonSchemaValidationWorkflowRunnerfor validatingFamilyOrBuilder.
-
cohortBuilder
public static JsonSchemaValidationWorkflowRunner.Builder<org.phenopackets.schema.v2.CohortOrBuilder> cohortBuilder()- Returns:
- a
JsonSchemaValidationWorkflowRunner.Builderfor 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>
-