Wiki

Clone wiki

t3lephant / JsonDataProvider

JsonDataProvider

This data provider works with *.json files only.

A very basic example of a json dump file is this:

[
{
    "uid": "1337",
    "title": "Just a test"
}
]

Validations

The following validations are checked:

  • Are any dumps registred?
  • Is the registred tableName of a dump also existing in database?
  • Is the given JSON valid?
  • Does given JSON start with an array?
  • Does a single JSON row contains attributes which are not existing in database?
  • Does the database table require an attribute, which is missing in JSON row?

The JsonDataProvider compares the attributes of each row in json dumps with database schema. If a column is defined as required in database (not null, no default), but the row is missing in dump this causes a validation error. Also when your dump contains attributes, which are not existing in database.

It is not necessary to add all attributes which a row has. Some attributes like "tstamp" make no sense here.


« Back to overview

Updated