Define & Validate APIsValidation RulesetsData Rulesets
JSON Data Validation
Validation checks performed on provided JSON data to check its conformance to standards.
| Property | Value |
|---|---|
| Ruleset ID | json-validation |
| Code prefix | JSON_V |
| Type | Validation |
| Default severity | Blocking |
| Rule system | Syntax |
| Rules | 21 |
JSON Property Key
| Code | Rule | Severity | What it checks |
|---|---|---|---|
JSON_V001 | valid-javascript-property-identifier-character | Blocking | A property of JSON is identified uniquely with a key, which must use valid characters only. |
JSON_V002 | valid-property-identifier-character | Blocking | A property of JSON is identified uniquely with a key, which must use valid characters only. |
JSON_V003 | complete-property-identifier-name | Blocking | A property of JSON is identified uniquely with a key, which must be valid and followed by a property value. |
JSON_V004 | between-property-identifier-name-and-value | Blocking | A property of JSON is identified uniquely with a key, which must be followed by a property value. The key and value must be separated by a semi-colon : and nothing else must be present between them. |
JSON Property Value
| Code | Rule | Severity | What it checks |
|---|---|---|---|
JSON_V100 | valid-property-value | Blocking | A JSON property key is followed by a property value which must start and terminate properly, escaped if necessary and quoted if applicable. |
JSON_V101 | valid-numeric-property-value | Blocking | A numeric property value does not require quotation marks. However, if the value is not a valid number it should be enclosed in double quotation marks to avoid any issues. |
JSON_V102 | valid-boolean-property-value | Blocking | A boolean property value should not be enclosed in quotation marks. The only allowed values are: true, false. |
JSON_V103 | valid-null-property-value | Blocking | A nullable property value can use null as its value which should not be enclosed in quotation marks. |
JSON_V104 | valid-date-or-datetime-property-value | Blocking | A date or datetime property value must use a valid date-time format in its string representation. |
JSON_V105 | quoted-property-value | Blocking | Some property values must be enclosed in double quotation marks and properly escaped to avoid issues. |
JSON_V106 | readable-value-token | Blocking | JSON data must be complete and valid for it be parsed successfully. The property key-value pairs in this JSON data must also be complete and follow syntax standards. |
JSON_V107 | no-extra-content-after-property-value | Blocking | JSON data must not contain any extra content after a property key-value pair. The property value must be terminated correctly to be parsed successfully. |
JSON_V108 | escaped-property-value | Blocking | A JSON property value must be escaped properly. This means that if any special or restricted characters are used they need to be escaped appropriately. |
JSON Start/End
| Code | Rule | Severity | What it checks |
|---|---|---|---|
JSON_V200 | complete-json-object | Blocking | A JSON object must consist of key-value property pairs which are terminated properly. |
JSON_V201 | complete-unicode-escape-sequence | Blocking | A value using Unicode escape sequence must be terminated correctly. |
JSON_V202 | complete-json-data | Blocking | JSON data must start and terminate properly. If some part of the data is missing or truncated, JSON parsing will fail. |
JSON_V203 | complete-comment | Blocking | A comment in a JSON file must be terminated correctly. |
JSON_V204 | valid-syntax-for-closing-json-token | Blocking | Ever JSON token has its own syntax for indicating the start and end of that token e.g. a JSON object must start and end with curly braces { and } respectively. Similarly, an array token must start and end with square braces [ and ] respectively. Multiple tokens are separated by a comma. |
JSON_V205 | no-extra-content-after-json-data-end | Blocking | Once the JSON data is complete and terminated, no extra content must be placed after it. |
Miscellaneous
| Code | Rule | Severity | What it checks |
|---|---|---|---|
JSON_V250 | valid-json-comment | Blocking | A valid JSON comment must start with double slashes. |
JSON_V251 | valid-json | Blocking | JSON data must follow standards defined in the official JSON specification. |