Diagnostics Schema for JSON#

Description#

Each application processing a document can generate diagnostics: a list of notifications the client. The diagnostics schema therefore describes the structure of this notification data returned from the Portal or the SDK before it is transformed to a native programming object such as the Diagnostics object for Python. It is the structure in which all application diagnostics for a processed document are represented.

Definition#

The Diagnostics schema is defined as:

  • array[Diagnostic] – The list of diagnostics

The Diagnostic schema is defined as:

  • object – The diagnostic

    • id (str) – The diagnostic identifier, e.g. "foo.txt"

    • message (str) – The message describing the notification

    • line (number) [optional] – The line number, if applicable

    • offset (number) [optional] – The offset in the line, if applicable

    • type (number) – The severity level of the diagnostic

Example#

The following is an example of diagnostics JSON data containing a single error on line 10, column 2 of file foobar.txt:

[
    {
        "id": "foobar.txt",
        "message": "Foobar went wrong",
        "line": 10,
        "offset": 2,
        "type": 40
    }
]