From 26c0e4763878ebd0af37e6cba54a0588aa79df4a Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Fri, 23 Sep 2022 09:53:55 -0700 Subject: [PATCH 1/2] Add discussion of loading/evaluation outcomes --- jsonschema-core.xml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index c0c7d99d..54a96802 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -608,6 +608,46 @@ +
+ + Evaluating an instance against a schema MUST produce one of four general outcomes: + + + + success: the evaluation completed without failing any validation assertions + + + failure: the evaluation completed with assertion failures + + + runtime error: the schema was understood but the evaluation could not + complete + + + refusal to process: the schema was not understood and evaluation never began + + + + + Runtime errors include but are not limited to: failure of reference resolution, + detection of an infinite reference loop, or excessive consumption of memory. + + + Implementations MAY detect certain refusal-to-process conditions when a schema is + loaded, prior to attempting any evaluation. For example, a schema that requires + a vocabulary that the implementation does not support cannot be processed + regardless of the instance. + + + Some conditions can manifest as either runtime or refusal-to-process outcomes. + For example, a reference to a non-existent location within a schema resource can + be detected at schema load time, but a reference to a non-existent external schema + might not be detected until runtime as that reference target schema might + be provided between the loading of the reference source schema and the first + attempted evaluation with an instance. + +
+
Additional schema keywords and schema vocabularies MAY be defined From 98c8d8475c8f9f85a2bd29648fd2c0858f3d262c Mon Sep 17 00:00:00 2001 From: "Henry H. Andrews" Date: Wed, 26 Oct 2022 18:22:58 -0700 Subject: [PATCH 2/2] Make refusal vs error less confusing The point at which the condition is detected should not change the type of outcome. --- jsonschema-core.xml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 54a96802..11fbe7e5 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -633,18 +633,10 @@ detection of an infinite reference loop, or excessive consumption of memory. - Implementations MAY detect certain refusal-to-process conditions when a schema is - loaded, prior to attempting any evaluation. For example, a schema that requires - a vocabulary that the implementation does not support cannot be processed - regardless of the instance. - - - Some conditions can manifest as either runtime or refusal-to-process outcomes. - For example, a reference to a non-existent location within a schema resource can - be detected at schema load time, but a reference to a non-existent external schema - might not be detected until runtime as that reference target schema might - be provided between the loading of the reference source schema and the first - attempted evaluation with an instance. + Unlike runtime errors, refusal-to-process is the expected outcome in certain cases. + Currently, the only situations where refusal-to-process is either required or allowed + are when a vocabulary cannot be supported, or a dialect cannot be determined. These + scenarios are noted in the appropriate sections of the specification.