2.1.0 • Published 2 years ago

@datawrapper/schemas v2.1.0

Weekly downloads
117
License
-
Repository
-
Last release
2 years ago

Schemas

JSON schemas for config, themes, teams etc.

How to validate data from production database

  1. Use the API to fetch the data. Example:

    $ curl -X GET "https://api.datawrapper.de/v3/admin/teams?limit=10000" \
           -H "Authorization:Bearer $AUTH_TOKEN" -o teams.json
  2. Convert the data to JSONL and optionally remove duplicate objects and compress it. Example:

    $ jq -r --indent 0 '.list[].settings' < teams.json | sort -u | gzip -c > teams.jsonl.gz
  3. Use scripts/validate-jsonl.js to validate the JSONL file against one of our schemas. Example:

    $ zcat teams.jsonl.gz | scripts/validate-jsonl.js teamSettings > errors.jsonl
    1 is valid
    2 has problems

    The file errors.jsonl will now contain information about the objects whose validation failed:

    {"lineNumber":2,"errorMessage":"\"foo\" is not allowed","originalData":{"foo":"bar"}}
2.1.0

2 years ago

2.0.0

2 years ago

2.0.0-alpha.0

3 years ago

1.18.0

3 years ago

1.17.0

3 years ago

1.16.0

3 years ago

1.15.8

4 years ago

1.15.7

4 years ago

1.18.0-1

3 years ago

1.18.0-0

3 years ago

1.17.0-1

3 years ago

1.17.0-0

3 years ago

1.17.0-3

3 years ago

1.17.0-2

3 years ago

1.15.6

4 years ago

1.15.4

4 years ago

1.15.3

4 years ago

1.15.5

4 years ago

1.15.2

4 years ago

1.15.0

4 years ago

1.15.1

4 years ago

1.14.0

4 years ago

1.13.1

4 years ago

1.13.0

4 years ago

1.12.1

4 years ago

1.12.0

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.4.0

5 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago