Help:Schema/Error handling

From semantic-mediawiki.org
Shows some schema validation errors caused by an inconsistent user input against a validation schema

There are two broad categories of errors that can occur while working with content in the smw/schema namespace.

Type of errors[edit]

  • JSON input error normally caused by some invalid syntax or incompatibilities with how the JSON should be structured
  • Schema validation against a validation schema may identify inconsistencies with the assigned schema and cause error(s)

Syntax error[edit]

The best and fastest method to produce a JSON compatible input is to use a online validation service or a JSON editor to check that the input document adheres the requirements to pass the JSON syntax check.

Validation error[edit]

A JSON validation schema can be assign to each schema type to help produce consistent schemata and eliminate maintenance effort during and after the input.

A validation schema defines constraints, restrictions, and characteristics of a JSON content using the json-schema.org specification and can be very strict on which properties, attributes and values are to be allowed or can be more lenient towards some user input.

Note: It should be noted that the detection of errors and their description are produced by a specialized component that is not part of Semantic MediaWiki or MediaWiki and therefore appear in English and cannot be translated.

 Error textError type
"NULL value found, but an object is required"NULL value found, but an object is requiredValidation error
"The property ... is not defined and the definition does not allow additional"The property ... is not defined and the definition does not allow additionalValidation error