Create JSON schema for all the data from your docs and sheets and then update your config file so the schema will be checked for any future data you pull with GoogleClient.getGoogleDocs.
Use this command once you're ready to lock in your data for publishing, and you can be sure the structure of your data will never change as a result of a malformed Google doc or sheet.
graphics google:lock-docs config.json
Description
Create JSON schemas for your Google docs
Usage
$ graphics google:lock-docs <conf> [options]
Options
-h, --help Displays this message
Config file path
Download Google docs and sheets to local JSON files.
CLI
Config file
Your config file should be in the following format that includes the ID from the Google doc or sheet and the path to where you'd like data from those docs to be written to locally. All paths should be relative to the current working directory when the script runs.
To find the ID of you doc or sheet, look for a long string of random characters in the URL of the file in Google Drive. You can find it between
https://.../d/< DOC ID HERE >/edit
. For example:https://docs.google.com/spreadsheets/d/1h1O8jPScxrUg-xmolKGSPzaePgyG3zbBkAWiijEpi0c/edit
You may also specify a path to a JSON schema, which will be used to validate your data:
Validation errors will cause the script to throw an error and quit. Alternatively, you can pass the
--skip
flag, which will continue getting other sheets and docs data specified in your conf as long as they are valid.