Convert JSON schema to Google BigQuery schema
npm install jsonschema-bigquery
const jsonSchemaBigquery = require('jsonschema-bigquery')
const inJson = {
"description": "Example description",
"type": "object",
"properties": {
"first_name": { "type": "string" },
"address": {
"type": "object",
"properties": {
"street_address": { "type": "string" }
}
}
}
}
const bigquery = jsonSchemaBigquery.convert(inJson)
Please ensure that the input JSON schema is dereferenced so that all external references have been resolved. json-schema-ref-parser can do this, prior to using this module.
npm test
- Error messages.