{ "$id": "root", "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "definitions": { "field": { "type": "object", "required": ["name", "type"], "additionalProperties": true, "properties": { "name": { "type": "string", "default": "id", "examples": ["id"] }, "type": { "type": "object", "required": ["pgType", "gqlType"], "additionalProperties": true, "properties": { "gqlType": { "type": ["string", "null"] }, "pgType": { "type": ["string", "null"] }, "subtype": { "type": ["string", "null"] } } } } } }, "properties": { "tables": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "default": "User", "examples": ["User"] }, "fields": { "type": "array", "items": { "$ref": "#/definitions/field" } }, "primaryConstraints": { "type": "array", "items": { "$ref": "#/definitions/field" } }, "uniqueConstraints": { "type": "array", "items": { "$ref": "#/definitions/field" } }, "foreignConstraints": { "type": "array", "items": { "type": "object", "properties": { "refTable": { "type": "string", "default": "User", "examples": ["User"] }, "fromKey": { "$ref": "#/definitions/field" }, "toKey": { "$ref": "#/definitions/field" } }, "required": ["refTable", "fromKey", "toKey"], "additionalProperties": false } } }, "required": ["name", "fields"], "additionalProperties": false } } }, "required": ["tables"], "additionalProperties": false }