Description
Report whether name is empty and whether requiredNames contains it.
A JSON Schema keyword expresses one constraint on an instance. Required-list membership, property naming, numeric bounds, and enum contents are distinct checks within a larger schema.
Report whether name is empty and whether requiredNames contains it.
When to use this tool
Use JSON Schema Property Name Empty Flag when you need one explicit schema-keyword or membership component.
How to use the tool and how it works
- Enter name, requiredNames, allowEmpty. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read empty, listedRequired, permittedByPolicy. Inspect empty, listedRequired, permittedByPolicy before interpreting the associated values.
Report whether name is empty and whether requiredNames contains it. permittedByPolicy is true for a nonempty name or when allowEmpty is true.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| name | Name | Required. Text; maximum UTF-16 length 8192. |
| requiredNames | Required Names | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| allowEmpty | Allow Empty | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| empty | Whether the represented collection or span has no occupied elements. | Required. Boolean. |
| listedRequired | Listed Required | Required. Boolean. |
| permittedByPolicy | Permitted By Policy | Required. Boolean. |
{
"input": {
"name": "",
"requiredNames": [
""
],
"allowEmpty": true
},
"output": {
"empty": true,
"listedRequired": true,
"permittedByPolicy": true
}
} Limitations and assumptions
- An empty JSON object key is syntactically possible; the caller's policy is separate from required-list membership and schema validity.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Validate the complete schema and instance using the intended dialect before treating a local check as conformance.
References
Similar or alternative tools
- JSON: JSON Schema Required Member Flag
Reject duplicate requiredMembers and test exact membership of memberName in that supplied list.
- JSON Schema Required Single Key Check
Parse objectJson as a plain JSON object and test Object.hasOwn for the literal key.