Specify fields, types and unknown values
This original JSON contract requires exactly four fields: date, time, headcount and status. Missing date or time is the JSON value null, not an empty string, the string "NULL", or an omitted field. headcount is a positive integer. status uses the exact literals "draft" and "pending-check" in both languages. If date is null, status must be "pending-check": structurally valid, but incomplete. Even a fully populated request grants no submission authority.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"additionalProperties": false,
"required": [
"date",
"time",
"headcount",
"status"
],
"properties": {
"date": {
"type": [
"string",
"null"
],
"pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"
},
"time": {
"type": [
"string",
"null"
],
"pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
},
"headcount": {
"type": "integer",
"minimum": 1
},
"status": {
"enum": [
"draft",
"pending-check"
]
}
},
"allOf": [
{
"if": {
"properties": {
"date": {
"type": "null"
}
},
"required": [
"date"
]
},
"then": {
"properties": {
"status": {
"const": "pending-check"
}
}
}
}
]
}| Supplied evidence | Question or input | Expected result |
|---|---|---|
| User: 3 April 2026, two people, time not given; null is the missing-value representation | Prepare a request record. | {"date":"2026-04-03","time":null,"headcount":2,"status":"draft"} — structurally valid draft; time remains unknown; no action submitted. |
| User: 03/04/2026, two people, no time or date convention; null is the unresolved-value representation | Prepare a request record and clarify the date. | {"date":null,"time":null,"headcount":2,"status":"pending-check"} — structurally valid but incomplete; ask whether 3 April or 4 March. No date chosen or action submitted. |
| User: 3 April 2026, two people, time not given; headcount must be an integer | Review {"date":"2026-04-03","time":null,"headcount":"2","status":"draft"}. | Invalid structure: "2" is a string, not integer 2. Expected record uses headcount:2. |
| User: 3 April 2026, two people, time not given | Review {"date":"2026-04-03","time":null,"headcount":20,"status":"draft"}. | Valid structure but wrong fact: headcount must be 2, not 20. Overall case fails. |
| User supplies no time; fields must be present; missing values use null | Review a missing time field, time:"", and time:"NULL". | All three are structurally invalid. Include "time":null. |
| Unresolved date requires status "pending-check"; literals do not change with locale | Review {"date":null,"time":null,"headcount":2,"status":"draft"}, or status:"草稿". | Both invalid: null date cannot use "draft"; "草稿" is a display label, not a permitted literal. |
Check structure and meaning separately
| Layer | Pass condition |
|---|---|
| Structure | Exactly the four required fields; declared types, patterns and status literals; null date requires "pending-check" |
| Meaning | Values match the user’s facts; unknowns remain null; date is a real calendar date, not just a matching pattern |
| Authority | A request record is not reported as a confirmed booking |
For example, {"date":"2026-02-30","time":null,"headcount":2,"status":"draft"} matches the schema’s date pattern but fails the separate calendar check. Keep the exact schema above with a downloaded case sheet. JSON Schema’s object and conditional references support the required-field, extra-field and conditional syntax used here; the request rules and instances are original. This sheet does not validate a provider feature or run a model.