jw3 commented on a change in pull request #431:
URL: https://github.com/apache/incubator-daffodil/pull/431#discussion_r504157057
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
##########
@@ -702,10 +706,22 @@ class ParseResult(dp: DataProcessor, override val
resultState: PState)
*/
def validateResult(bytes: Array[Byte]): Unit = {
Assert.usage(resultState.processorStatus eq Success)
- val schemaURIStrings =
resultState.infoset.asInstanceOf[InfosetElement].runtimeData.schemaURIStringsForFullValidation
+
+ val (v, args) = dp.validationMode match {
+ case ValidationMode.Custom(name, args) =>
+ Validators.find(name).getOrElse(
+ Assert.abort(s"Validator '$name' not found")
Review comment:
I wanted to fail faster then this point, which is done in the CLI, but
when using the API you can fall through to here and have to catch the Validator
doesnt exist.
There is at least one way to enforce something in the API, but Im not sure
its cleaner than doing nothing and just throwing late (eg. factory to produce
the CustomValidationMode that ensures a validator exists).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]