Socket
Socket
Sign inDemoInstall

@datawrapper/schemas

Package Overview
Dependencies
6
Maintainers
20
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @datawrapper/schemas

JSON schemas for config and themes


Version published
Weekly downloads
8
increased by300%
Maintainers
20
Install size
2.06 MB
Created
Weekly downloads
 

Readme

Source

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"}}
    

FAQs

Last updated on 06 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc