nssalian commented on code in PR #9:
URL: 
https://github.com/apache/iceberg-verification/pull/9#discussion_r4099448087


##########
dev/schema/cases.base.schema.json:
##########
@@ -0,0 +1,49 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema";,
+  "$id": "https://iceberg.apache.org/verification/cases.base.schema.json";,
+  "title": "Conformance cases (base)",
+  "description": "Structure shared by every table-spec surface's cases.json.",
+  "type": "object",
+  "required": ["cases"],
+  "additionalProperties": false,
+  "properties": {
+    "cases": {
+      "type": "array",
+      "items": { "$ref": "#/$defs/case" }
+    }
+  },
+  "$defs": {
+    "case": {
+      "type": "object",
+      "required": ["id", "valid", "input"],
+      "additionalProperties": false,
+      "properties": {
+        "id": { "type": "string", "minLength": 1 },
+        "valid": { "type": "boolean" },
+        "input": true,
+        "decoded": true,
+        "canonical": { "type": "string" },
+        "clause": { "type": "string" },
+        "spec_ref": { "type": "string" },
+        "normative_level": { "enum": ["must", "should"], "description": "must 
(default) or should. A should case is advisory (the spec only recommends the 
behavior); a runner must report a failed should distinctly from a pass, so the 
advisory tier stays visible rather than reading as inert." }
+      },
+      "allOf": [
+        {
+          "$comment": "a valid case must carry decoded",
+          "if": { "properties": { "valid": { "const": true } }, "required": 
["valid"] },
+          "then": { "required": ["decoded"] }
+        },
+        {
+          "$comment": "an invalid case must not carry decoded",
+          "if": { "properties": { "valid": { "const": false } }, "required": 
["valid"] },
+          "then": { "not": { "required": ["decoded"] } }

Review Comment:
   Switched to `"then": {"properties": {"decoded": false}}`, with a self-test 
feeding a `valid: false` case carrying `decoded`. The old `not: {required: 
[decoded]}` also rejected that case in a local run; `properties: {decoded: 
false}` is clearer.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to