Interface ValidationWorkflowRunner<T extends com.google.protobuf.MessageOrBuilder>
- Type Parameters:
T
- type of the top-level element of the Phenopacket Schema.
- All Known Implementing Classes:
JsonSchemaValidationWorkflowRunner
ValidationWorkflowRunner
validates selected top-level element of the Phenopacket Schema.
The validation is performed on 3 input types: validate(MessageOrBuilder)
validates an existing top-level
element, validate(String)
validates input formatted either
in PhenopacketFormat.JSON
or PhenopacketFormat.YAML
,
and validate(byte[])
validates a pile of bytes that can be in either
of the PhenopacketFormat
s.
Validator provides a list with ValidatorInfo
that describes validations
done by the ValidationWorkflowRunner
.
The validation is generally done in 2 phases, syntax and semantic phases.
The syntax phase checks if the building blocks meet the requirements independently
(e.g. all required fields are defined for a Resource
).
The semantic validation checks for presence of errors in the context of the entire top-level element
(e.g. a phenopacket contains an HPO term but an HPO Resource
is missing
in MetaData
).
-
Method Summary
Modifier and TypeMethodDescriptionvalidate
(byte[] payload) Validate a top-level element starting from a pile of bytes.default ValidationResults
validate
(InputStream is) Validate a top-level element starting from a string.default ValidationResults
Validate a top-level element starting from a protobuf item.
-
Method Details
-
validators
List<ValidatorInfo> validators()- Returns:
- a list with
ValidatorInfo
s describing the validations done by theValidationWorkflowRunner
.
-
validate
Validate a top-level element starting from a pile of bytes.- Parameters:
payload
- top-level element in one of thePhenopacketFormat
s.- Returns:
- the validation results.
-
validate
Validate a top-level element starting from a string.- Parameters:
value
- top-level element in eitherPhenopacketFormat.JSON
orPhenopacketFormat.YAML
.- Returns:
- the validation results.
-
validate
Validate a top-level element starting from a protobuf item.- Parameters:
item
- the top-level element as protobuf item.- Returns:
- the validation results.
-
validate
- Throws:
IOException
-
validate
- Throws:
IOException
-