{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Capabilities Response",
"type": "object",
"required": [
"capabilities",
"version"
],
"properties": {
"version": {
"type": "string"
},
"capabilities": {
"$ref": "#/definitions/Capabilities"
}
},
"definitions": {
"AggregateCapabilities": {
"title": "Aggregate Capabilities",
"type": "object",
"properties": {
"filter_by": {
"description": "Does the connector support filtering based on aggregated values",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"group_by": {
"description": "Does the connector support aggregations over groups",
"anyOf": [
{
"$ref": "#/definitions/GroupByCapabilities"
},
{
"type": "null"
}
]
}
}
},
"Capabilities": {
"title": "Capabilities",
"description": "Describes the features of the specification which a data connector implements.",
"type": "object",
"required": [
"mutation",
"query"
],
"properties": {
"query": {
"$ref": "#/definitions/QueryCapabilities"
},
"mutation": {
"$ref": "#/definitions/MutationCapabilities"
},
"relationships": {
"anyOf": [
{
"$ref": "#/definitions/RelationshipCapabilities"
},
{
"type": "null"
}
]
}
}
},
"ExistsCapabilities": {
"title": "Exists Capabilities",
"type": "object",
"properties": {
"named_scopes": {
"description": "Does the connector support named scopes in column references inside EXISTS predicates",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"unrelated": {
"description": "Does the connector support ExistsInCollection::Unrelated",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested_collections": {
"description": "Does the connector support ExistsInCollection::NestedCollection",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested_scalar_collections": {
"description": "Does the connector support filtering over nested scalar arrays using existential quantification. This means the connector must support ExistsInCollection::NestedScalarCollection.",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"GroupByCapabilities": {
"title": "Group By Capabilities",
"type": "object",
"properties": {
"filter": {
"description": "Does the connector support post-grouping predicates",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"order": {
"description": "Does the connector support post-grouping ordering",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"paginate": {
"description": "Does the connector support post-grouping pagination",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"LeafCapability": {
"description": "A unit value to indicate a particular leaf capability is supported. This is an empty struct to allow for future sub-capabilities.",
"type": "object"
},
"MutationCapabilities": {
"title": "Mutation Capabilities",
"type": "object",
"properties": {
"transactional": {
"description": "Does the connector support executing multiple mutations in a transaction.",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"explain": {
"description": "Does the connector support explaining mutations",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"NestedArrayFilterByCapabilities": {
"title": "Nested Array Filter By Capabilities",
"type": "object",
"properties": {
"contains": {
"description": "Does the connector support filtering over nested arrays by checking if the array contains a value. This must be supported for all types that can be contained in an array that implement an 'eq' comparison operator.",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"is_empty": {
"description": "Does the connector support filtering over nested arrays by checking if the array is empty. This must be supported no matter what type is contained in the array.",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"NestedFieldCapabilities": {
"title": "Nested Field Capabilities",
"type": "object",
"properties": {
"filter_by": {
"description": "Does the connector support filtering by values of nested fields",
"anyOf": [
{
"$ref": "#/definitions/NestedFieldFilterByCapabilities"
},
{
"type": "null"
}
]
},
"order_by": {
"description": "Does the connector support ordering by values of nested fields",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"aggregates": {
"description": "Does the connector support aggregating values within nested fields",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested_collections": {
"description": "Does the connector support nested collection queries using `NestedField::NestedCollection`",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"NestedFieldFilterByCapabilities": {
"title": "Nested Field Filter By Capabilities",
"type": "object",
"properties": {
"nested_arrays": {
"description": "Does the connector support filtering over nested arrays (ie. Expression::ArrayComparison)",
"anyOf": [
{
"$ref": "#/definitions/NestedArrayFilterByCapabilities"
},
{
"type": "null"
}
]
}
}
},
"NestedRelationshipCapabilities": {
"title": "Nested Relationship Capabilities",
"type": "object",
"properties": {
"array": {
"description": "Does the connector support navigating a relationship from inside a nested object inside a nested array",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"filtering": {
"description": "Does the connector support filtering over a relationship that starts from inside a nested object",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"ordering": {
"description": "Does the connector support ordering over a relationship that starts from inside a nested object",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
}
}
},
"QueryCapabilities": {
"title": "Query Capabilities",
"type": "object",
"properties": {
"aggregates": {
"description": "Does the connector support aggregate queries",
"anyOf": [
{
"$ref": "#/definitions/AggregateCapabilities"
},
{
"type": "null"
}
]
},
"variables": {
"description": "Does the connector support queries which use variables",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"explain": {
"description": "Does the connector support explaining queries",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested_fields": {
"description": "Does the connector support nested fields",
"default": {},
"allOf": [
{
"$ref": "#/definitions/NestedFieldCapabilities"
}
]
},
"exists": {
"description": "Does the connector support EXISTS predicates",
"default": {},
"allOf": [
{
"$ref": "#/definitions/ExistsCapabilities"
}
]
}
}
},
"RelationshipCapabilities": {
"title": "Relationship Capabilities",
"type": "object",
"properties": {
"relation_comparisons": {
"description": "Does the connector support comparisons that involve related collections (ie. joins)?",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"order_by_aggregate": {
"description": "Does the connector support ordering by an aggregated array relationship?",
"anyOf": [
{
"$ref": "#/definitions/LeafCapability"
},
{
"type": "null"
}
]
},
"nested": {
"description": "Does the connector support navigating a relationship from inside a nested object",
"anyOf": [
{
"$ref": "#/definitions/NestedRelationshipCapabilities"
},
{
"type": "null"
}
]
}
}
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Error Response",
"type": "object",
"required": [
"details",
"message"
],
"properties": {
"message": {
"description": "A human-readable summary of the error",
"type": "string"
},
"details": {
"description": "Any additional structured information about the error"
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Explain Response",
"type": "object",
"required": [
"details"
],
"properties": {
"details": {
"description": "A list of human-readable key-value pairs describing a query execution plan. For example, a connector for a relational database might return the generated SQL and/or the output of the `EXPLAIN` command. An API-based connector might encode a list of statically-known API calls which would be made.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Mutation Request",
"type": "object",
"required": [
"collection_relationships",
"operations"
],
"properties": {
"operations": {
"description": "The mutation operations to perform",
"type": "array",
"items": {
"$ref": "#/definitions/MutationOperation"
}
},
"collection_relationships": {
"description": "The relationships between collections involved in the entire mutation request. Only used if the 'relationships' capability is supported.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Relationship"
}
}
},
"definitions": {
"Aggregate": {
"title": "Aggregate",
"oneOf": [
{
"type": "object",
"required": [
"column",
"distinct",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column_count"
]
},
"column": {
"description": "The column to apply the count aggregate function to",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"distinct": {
"description": "Whether or not only distinct items should be counted",
"type": "boolean"
}
}
},
{
"type": "object",
"required": [
"column",
"function",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"single_column"
]
},
"column": {
"description": "The column to apply the aggregation function to",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"function": {
"description": "Single column aggregate function name.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"star_count"
]
}
}
}
]
},
"Argument": {
"title": "Argument",
"oneOf": [
{
"description": "The argument is provided by reference to a variable. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
},
{
"description": "The argument is provided as a literal value",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"literal"
]
},
"value": true
}
}
]
},
"ArrayComparison": {
"title": "Array Comparison",
"oneOf": [
{
"description": "Check if the array contains the specified value. Only used if the 'query.nested_fields.filter_by.nested_arrays.contains' capability is supported.",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"contains"
]
},
"value": {
"$ref": "#/definitions/ComparisonValue"
}
}
},
{
"description": "Check is the array is empty. Only used if the 'query.nested_fields.filter_by.nested_arrays.is_empty' capability is supported.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"is_empty"
]
}
}
}
]
},
"ComparisonTarget": {
"title": "Comparison Target",
"oneOf": [
{
"description": "The comparison targets a column.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.filter_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
}
},
{
"description": "The comparison targets the result of aggregation. Only used if the 'query.aggregates.filter_by' capability is supported.",
"type": "object",
"required": [
"aggregate",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"path": {
"description": "Non-empty collection of relationships to traverse",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"aggregate": {
"description": "The aggregation method to use",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"ComparisonValue": {
"title": "Comparison Value",
"oneOf": [
{
"description": "The value to compare against should be drawn from another column",
"type": "object",
"required": [
"name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any relationships to traverse to reach this column. Only non-empty if the 'relationships.relation_comparisons' is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.filter_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"scope": {
"description": "The scope in which this column exists, identified by an top-down index into the stack of scopes. The stack grows inside each `Expression::Exists`, so scope 0 (the default) refers to the current collection, and each subsequent index refers to the collection outside its predecessor's immediately enclosing `Expression::Exists` expression. Only used if the 'query.exists.named_scopes' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0.0
}
}
},
{
"description": "A scalar value to compare against",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"scalar"
]
},
"value": true
}
},
{
"description": "A value to compare against that is to be drawn from the query's variables. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
}
]
},
"Dimension": {
"title": "Dimension",
"oneOf": [
{
"type": "object",
"required": [
"column_name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any (object) relationships to traverse to reach this column. Only non-empty if the 'relationships' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"column_name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column_name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"extraction": {
"description": "The name of the extraction function to apply to the selected value, if any",
"type": [
"string",
"null"
]
}
}
}
]
},
"ExistsInCollection": {
"title": "Exists In Collection",
"oneOf": [
{
"description": "The rows to evaluate the exists predicate against come from a related collection. Only used if the 'relationships' capability is supported.",
"type": "object",
"required": [
"arguments",
"relationship",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"related"
]
},
"field_path": {
"description": "Path to a nested field within an object column that must be navigated before the relationship is navigated. Only non-empty if the 'relationships.nested.filtering' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"relationship": {
"description": "The name of the relationship to follow",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
{
"description": "The rows to evaluate the exists predicate against come from an unrelated collection Only used if the 'query.exists.unrelated' capability is supported.",
"type": "object",
"required": [
"arguments",
"collection",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unrelated"
]
},
"collection": {
"description": "The name of a collection",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
{
"description": "The rows to evaluate the exists predicate against come from a nested array field. Only used if the 'query.exists.nested_collections' capability is supported.",
"type": "object",
"required": [
"column_name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nested_collection"
]
},
"column_name": {
"type": "string"
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested collection via object columns",
"type": "array",
"items": {
"type": "string"
}
}
}
},
{
"description": "Specifies a column that contains a nested array of scalars. The array will be brought into scope of the nested expression where each element becomes an object with one '__value' column that contains the element value. Only used if the 'query.exists.nested_scalar_collections' capability is supported.",
"type": "object",
"required": [
"column_name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nested_scalar_collection"
]
},
"column_name": {
"type": "string"
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested collection via object columns",
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
},
"Expression": {
"title": "Expression",
"oneOf": [
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"and"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/Expression"
}
}
}
},
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"or"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/Expression"
}
}
}
},
{
"type": "object",
"required": [
"expression",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"not"
]
},
"expression": {
"$ref": "#/definitions/Expression"
}
}
},
{
"type": "object",
"required": [
"column",
"operator",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unary_comparison_operator"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"operator": {
"$ref": "#/definitions/UnaryComparisonOperator"
}
}
},
{
"type": "object",
"required": [
"column",
"operator",
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"binary_comparison_operator"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"operator": {
"type": "string"
},
"value": {
"$ref": "#/definitions/ComparisonValue"
}
}
},
{
"description": "A comparison against a nested array column. Only used if the 'query.nested_fields.filter_by.nested_arrays' capability is supported.",
"type": "object",
"required": [
"column",
"comparison",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"array_comparison"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"comparison": {
"$ref": "#/definitions/ArrayComparison"
}
}
},
{
"type": "object",
"required": [
"in_collection",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"exists"
]
},
"in_collection": {
"$ref": "#/definitions/ExistsInCollection"
},
"predicate": {
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
}
}
}
]
},
"Field": {
"title": "Field",
"oneOf": [
{
"description": "A field satisfied by returning the value of a row's column.",
"type": "object",
"required": [
"column",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"column": {
"type": "string"
},
"fields": {
"description": "When the type of the column is a (possibly-nullable) array or object, the caller can request a subset of the complete column data, by specifying fields to fetch here. If omitted, the column data will be fetched in full.",
"anyOf": [
{
"$ref": "#/definitions/NestedField"
},
{
"type": "null"
}
]
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
}
}
},
{
"description": "A field satisfied by navigating a relationship from the current row to a related collection. Only used if the 'relationships' capability is supported.",
"type": "object",
"required": [
"arguments",
"query",
"relationship",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"relationship"
]
},
"query": {
"$ref": "#/definitions/Query"
},
"relationship": {
"description": "The name of the relationship to follow for the subquery",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
}
]
},
"GroupComparisonTarget": {
"title": "Aggregate Comparison Target",
"oneOf": [
{
"type": "object",
"required": [
"aggregate",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"aggregate": {
"$ref": "#/definitions/Aggregate"
}
}
}
]
},
"GroupComparisonValue": {
"title": "Aggregate Comparison Value",
"oneOf": [
{
"description": "A scalar value to compare against",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"scalar"
]
},
"value": true
}
},
{
"description": "A value to compare against that is to be drawn from the query's variables. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
}
]
},
"GroupExpression": {
"title": "Group Expression",
"oneOf": [
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"and"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/GroupExpression"
}
}
}
},
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"or"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/GroupExpression"
}
}
}
},
{
"type": "object",
"required": [
"expression",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"not"
]
},
"expression": {
"$ref": "#/definitions/GroupExpression"
}
}
},
{
"type": "object",
"required": [
"operator",
"target",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unary_comparison_operator"
]
},
"target": {
"$ref": "#/definitions/GroupComparisonTarget"
},
"operator": {
"$ref": "#/definitions/UnaryComparisonOperator"
}
}
},
{
"type": "object",
"required": [
"operator",
"target",
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"binary_comparison_operator"
]
},
"target": {
"$ref": "#/definitions/GroupComparisonTarget"
},
"operator": {
"type": "string"
},
"value": {
"$ref": "#/definitions/GroupComparisonValue"
}
}
}
]
},
"GroupOrderBy": {
"title": "Group Order By",
"type": "object",
"required": [
"elements"
],
"properties": {
"elements": {
"description": "The elements to order by, in priority order",
"type": "array",
"items": {
"$ref": "#/definitions/GroupOrderByElement"
}
}
}
},
"GroupOrderByElement": {
"title": "Group Order By Element",
"type": "object",
"required": [
"order_direction",
"target"
],
"properties": {
"order_direction": {
"$ref": "#/definitions/OrderDirection"
},
"target": {
"$ref": "#/definitions/GroupOrderByTarget"
}
}
},
"GroupOrderByTarget": {
"title": "Group Order By Target",
"oneOf": [
{
"type": "object",
"required": [
"index",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"dimension"
]
},
"index": {
"description": "The index of the dimension to order by, selected from the dimensions provided in the `Grouping` request.",
"type": "integer",
"format": "uint",
"minimum": 0.0
}
}
},
{
"type": "object",
"required": [
"aggregate",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"aggregate": {
"description": "Aggregation method to apply",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"Grouping": {
"title": "Grouping",
"type": "object",
"required": [
"aggregates",
"dimensions"
],
"properties": {
"dimensions": {
"description": "Dimensions along which to partition the data",
"type": "array",
"items": {
"$ref": "#/definitions/Dimension"
}
},
"aggregates": {
"description": "Aggregates to compute in each group",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Aggregate"
}
},
"predicate": {
"description": "Optionally specify a predicate to apply after grouping rows. Only used if the 'query.aggregates.group_by.filter' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/GroupExpression"
},
{
"type": "null"
}
]
},
"order_by": {
"description": "Optionally specify how groups should be ordered Only used if the 'query.aggregates.group_by.order' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/GroupOrderBy"
},
{
"type": "null"
}
]
},
"limit": {
"description": "Optionally limit to N groups Only used if the 'query.aggregates.group_by.paginate' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"offset": {
"description": "Optionally offset from the Nth group Only used if the 'query.aggregates.group_by.paginate' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
}
}
},
"MutationOperation": {
"title": "Mutation Operation",
"oneOf": [
{
"type": "object",
"required": [
"arguments",
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"procedure"
]
},
"name": {
"description": "The name of a procedure",
"type": "string"
},
"arguments": {
"description": "Any named procedure arguments",
"type": "object",
"additionalProperties": true
},
"fields": {
"description": "The fields to return from the result, or null to return everything",
"anyOf": [
{
"$ref": "#/definitions/NestedField"
},
{
"type": "null"
}
]
}
}
}
]
},
"NestedField": {
"title": "NestedField",
"oneOf": [
{
"title": "NestedObject",
"type": "object",
"required": [
"fields",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"object"
]
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Field"
}
}
}
},
{
"title": "NestedArray",
"type": "object",
"required": [
"fields",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"array"
]
},
"fields": {
"$ref": "#/definitions/NestedField"
}
}
},
{
"title": "NestedCollection",
"description": "Perform a query over the nested array's rows. Only used if the 'query.nested_fields.nested_collections' capability is supported.",
"type": "object",
"required": [
"query",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"collection"
]
},
"query": {
"$ref": "#/definitions/Query"
}
}
}
]
},
"OrderBy": {
"title": "Order By",
"type": "object",
"required": [
"elements"
],
"properties": {
"elements": {
"description": "The elements to order by, in priority order",
"type": "array",
"items": {
"$ref": "#/definitions/OrderByElement"
}
}
}
},
"OrderByElement": {
"title": "Order By Element",
"type": "object",
"required": [
"order_direction",
"target"
],
"properties": {
"order_direction": {
"$ref": "#/definitions/OrderDirection"
},
"target": {
"$ref": "#/definitions/OrderByTarget"
}
}
},
"OrderByTarget": {
"title": "Order By Target",
"oneOf": [
{
"description": "The ordering is performed over a column.",
"type": "object",
"required": [
"name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any (object) relationships to traverse to reach this column. Only non-empty if the 'relationships' capability is supported. 'PathElement.field_path' will only be non-empty if the 'relationships.nested.ordering' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.order_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
}
},
{
"description": "The ordering is performed over the result of an aggregation. Only used if the 'relationships.order_by_aggregate' capability is supported.",
"type": "object",
"required": [
"aggregate",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"path": {
"description": "Non-empty collection of relationships to traverse. Only non-empty if the 'relationships' capability is supported. 'PathElement.field_path' will only be non-empty if the 'relationships.nested.ordering' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"aggregate": {
"description": "The aggregation method to use",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"OrderDirection": {
"title": "Order Direction",
"type": "string",
"enum": [
"asc",
"desc"
]
},
"PathElement": {
"title": "Path Element",
"type": "object",
"required": [
"arguments",
"relationship"
],
"properties": {
"field_path": {
"description": "Path to a nested field within an object column that must be navigated before the relationship is navigated. Only non-empty if the 'relationships.nested' capability is supported (plus perhaps one of the sub-capabilities, depending on the feature using the PathElement).",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"relationship": {
"description": "The name of the relationship to follow",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
},
"predicate": {
"description": "A predicate expression to apply to the target collection",
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
}
}
},
"Query": {
"title": "Query",
"type": "object",
"properties": {
"aggregates": {
"description": "Aggregate fields of the query. Only used if the 'query.aggregates' capability is supported.",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/Aggregate"
}
},
"fields": {
"description": "Fields of the query",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/Field"
}
},
"limit": {
"description": "Optionally limit to N results",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"offset": {
"description": "Optionally offset from the Nth result",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"order_by": {
"description": "Optionally specify how rows should be ordered",
"anyOf": [
{
"$ref": "#/definitions/OrderBy"
},
{
"type": "null"
}
]
},
"predicate": {
"description": "Optionally specify a predicate to apply to the rows",
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
},
"groups": {
"description": "Optionally group and aggregate the selected rows. Only used if the 'query.aggregates.group_by' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/Grouping"
},
{
"type": "null"
}
]
}
}
},
"Relationship": {
"title": "Relationship",
"type": "object",
"required": [
"arguments",
"column_mapping",
"relationship_type",
"target_collection"
],
"properties": {
"column_mapping": {
"description": "A mapping between columns on the source row to columns on the target collection. The column on the target collection is specified via a field path (ie. an array of field names that descend through nested object fields). The field path will only contain a single item, meaning a column on the target collection's type, unless the 'relationships.nested' capability is supported, in which case multiple items denotes a nested object field.",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"relationship_type": {
"$ref": "#/definitions/RelationshipType"
},
"target_collection": {
"description": "The name of a collection",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
"RelationshipArgument": {
"title": "Relationship Argument",
"oneOf": [
{
"description": "The argument is provided by reference to a variable. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
},
{
"description": "The argument is provided as a literal value",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"literal"
]
},
"value": true
}
},
{
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"name": {
"type": "string"
}
}
}
]
},
"RelationshipType": {
"title": "Relationship Type",
"type": "string",
"enum": [
"object",
"array"
]
},
"UnaryComparisonOperator": {
"title": "Unary Comparison Operator",
"type": "string",
"enum": [
"is_null"
]
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Mutation Response",
"type": "object",
"required": [
"operation_results"
],
"properties": {
"operation_results": {
"description": "The results of each mutation operation, in the same order as they were received",
"type": "array",
"items": {
"$ref": "#/definitions/MutationOperationResults"
}
}
},
"definitions": {
"MutationOperationResults": {
"title": "Mutation Operation Results",
"oneOf": [
{
"type": "object",
"required": [
"result",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"procedure"
]
},
"result": true
}
}
]
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Query Request",
"description": "This is the request body of the query POST endpoint",
"type": "object",
"required": [
"arguments",
"collection",
"collection_relationships",
"query"
],
"properties": {
"collection": {
"description": "The name of a collection",
"type": "string"
},
"query": {
"description": "The query syntax tree",
"allOf": [
{
"$ref": "#/definitions/Query"
}
]
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"collection_relationships": {
"description": "Any relationships between collections involved in the query request. Only used if the 'relationships' capability is supported.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Relationship"
}
},
"variables": {
"description": "One set of named variables for each rowset to fetch. Each variable set should be subtituted in turn, and a fresh set of rows returned. Only used if the 'query.variables' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "object",
"additionalProperties": true
}
}
},
"definitions": {
"Aggregate": {
"title": "Aggregate",
"oneOf": [
{
"type": "object",
"required": [
"column",
"distinct",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column_count"
]
},
"column": {
"description": "The column to apply the count aggregate function to",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"distinct": {
"description": "Whether or not only distinct items should be counted",
"type": "boolean"
}
}
},
{
"type": "object",
"required": [
"column",
"function",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"single_column"
]
},
"column": {
"description": "The column to apply the aggregation function to",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"function": {
"description": "Single column aggregate function name.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"star_count"
]
}
}
}
]
},
"Argument": {
"title": "Argument",
"oneOf": [
{
"description": "The argument is provided by reference to a variable. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
},
{
"description": "The argument is provided as a literal value",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"literal"
]
},
"value": true
}
}
]
},
"ArrayComparison": {
"title": "Array Comparison",
"oneOf": [
{
"description": "Check if the array contains the specified value. Only used if the 'query.nested_fields.filter_by.nested_arrays.contains' capability is supported.",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"contains"
]
},
"value": {
"$ref": "#/definitions/ComparisonValue"
}
}
},
{
"description": "Check is the array is empty. Only used if the 'query.nested_fields.filter_by.nested_arrays.is_empty' capability is supported.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"is_empty"
]
}
}
}
]
},
"ComparisonTarget": {
"title": "Comparison Target",
"oneOf": [
{
"description": "The comparison targets a column.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.filter_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
}
},
{
"description": "The comparison targets the result of aggregation. Only used if the 'query.aggregates.filter_by' capability is supported.",
"type": "object",
"required": [
"aggregate",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"path": {
"description": "Non-empty collection of relationships to traverse",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"aggregate": {
"description": "The aggregation method to use",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"ComparisonValue": {
"title": "Comparison Value",
"oneOf": [
{
"description": "The value to compare against should be drawn from another column",
"type": "object",
"required": [
"name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any relationships to traverse to reach this column. Only non-empty if the 'relationships.relation_comparisons' is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.filter_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"scope": {
"description": "The scope in which this column exists, identified by an top-down index into the stack of scopes. The stack grows inside each `Expression::Exists`, so scope 0 (the default) refers to the current collection, and each subsequent index refers to the collection outside its predecessor's immediately enclosing `Expression::Exists` expression. Only used if the 'query.exists.named_scopes' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0.0
}
}
},
{
"description": "A scalar value to compare against",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"scalar"
]
},
"value": true
}
},
{
"description": "A value to compare against that is to be drawn from the query's variables. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
}
]
},
"Dimension": {
"title": "Dimension",
"oneOf": [
{
"type": "object",
"required": [
"column_name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any (object) relationships to traverse to reach this column. Only non-empty if the 'relationships' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"column_name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column_name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"extraction": {
"description": "The name of the extraction function to apply to the selected value, if any",
"type": [
"string",
"null"
]
}
}
}
]
},
"ExistsInCollection": {
"title": "Exists In Collection",
"oneOf": [
{
"description": "The rows to evaluate the exists predicate against come from a related collection. Only used if the 'relationships' capability is supported.",
"type": "object",
"required": [
"arguments",
"relationship",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"related"
]
},
"field_path": {
"description": "Path to a nested field within an object column that must be navigated before the relationship is navigated. Only non-empty if the 'relationships.nested.filtering' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"relationship": {
"description": "The name of the relationship to follow",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
{
"description": "The rows to evaluate the exists predicate against come from an unrelated collection Only used if the 'query.exists.unrelated' capability is supported.",
"type": "object",
"required": [
"arguments",
"collection",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unrelated"
]
},
"collection": {
"description": "The name of a collection",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
{
"description": "The rows to evaluate the exists predicate against come from a nested array field. Only used if the 'query.exists.nested_collections' capability is supported.",
"type": "object",
"required": [
"column_name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nested_collection"
]
},
"column_name": {
"type": "string"
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested collection via object columns",
"type": "array",
"items": {
"type": "string"
}
}
}
},
{
"description": "Specifies a column that contains a nested array of scalars. The array will be brought into scope of the nested expression where each element becomes an object with one '__value' column that contains the element value. Only used if the 'query.exists.nested_scalar_collections' capability is supported.",
"type": "object",
"required": [
"column_name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nested_scalar_collection"
]
},
"column_name": {
"type": "string"
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested collection via object columns",
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
},
"Expression": {
"title": "Expression",
"oneOf": [
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"and"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/Expression"
}
}
}
},
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"or"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/Expression"
}
}
}
},
{
"type": "object",
"required": [
"expression",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"not"
]
},
"expression": {
"$ref": "#/definitions/Expression"
}
}
},
{
"type": "object",
"required": [
"column",
"operator",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unary_comparison_operator"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"operator": {
"$ref": "#/definitions/UnaryComparisonOperator"
}
}
},
{
"type": "object",
"required": [
"column",
"operator",
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"binary_comparison_operator"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"operator": {
"type": "string"
},
"value": {
"$ref": "#/definitions/ComparisonValue"
}
}
},
{
"description": "A comparison against a nested array column. Only used if the 'query.nested_fields.filter_by.nested_arrays' capability is supported.",
"type": "object",
"required": [
"column",
"comparison",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"array_comparison"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"comparison": {
"$ref": "#/definitions/ArrayComparison"
}
}
},
{
"type": "object",
"required": [
"in_collection",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"exists"
]
},
"in_collection": {
"$ref": "#/definitions/ExistsInCollection"
},
"predicate": {
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
}
}
}
]
},
"Field": {
"title": "Field",
"oneOf": [
{
"description": "A field satisfied by returning the value of a row's column.",
"type": "object",
"required": [
"column",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"column": {
"type": "string"
},
"fields": {
"description": "When the type of the column is a (possibly-nullable) array or object, the caller can request a subset of the complete column data, by specifying fields to fetch here. If omitted, the column data will be fetched in full.",
"anyOf": [
{
"$ref": "#/definitions/NestedField"
},
{
"type": "null"
}
]
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
}
}
},
{
"description": "A field satisfied by navigating a relationship from the current row to a related collection. Only used if the 'relationships' capability is supported.",
"type": "object",
"required": [
"arguments",
"query",
"relationship",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"relationship"
]
},
"query": {
"$ref": "#/definitions/Query"
},
"relationship": {
"description": "The name of the relationship to follow for the subquery",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
}
]
},
"GroupComparisonTarget": {
"title": "Aggregate Comparison Target",
"oneOf": [
{
"type": "object",
"required": [
"aggregate",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"aggregate": {
"$ref": "#/definitions/Aggregate"
}
}
}
]
},
"GroupComparisonValue": {
"title": "Aggregate Comparison Value",
"oneOf": [
{
"description": "A scalar value to compare against",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"scalar"
]
},
"value": true
}
},
{
"description": "A value to compare against that is to be drawn from the query's variables. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
}
]
},
"GroupExpression": {
"title": "Group Expression",
"oneOf": [
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"and"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/GroupExpression"
}
}
}
},
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"or"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/GroupExpression"
}
}
}
},
{
"type": "object",
"required": [
"expression",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"not"
]
},
"expression": {
"$ref": "#/definitions/GroupExpression"
}
}
},
{
"type": "object",
"required": [
"operator",
"target",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unary_comparison_operator"
]
},
"target": {
"$ref": "#/definitions/GroupComparisonTarget"
},
"operator": {
"$ref": "#/definitions/UnaryComparisonOperator"
}
}
},
{
"type": "object",
"required": [
"operator",
"target",
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"binary_comparison_operator"
]
},
"target": {
"$ref": "#/definitions/GroupComparisonTarget"
},
"operator": {
"type": "string"
},
"value": {
"$ref": "#/definitions/GroupComparisonValue"
}
}
}
]
},
"GroupOrderBy": {
"title": "Group Order By",
"type": "object",
"required": [
"elements"
],
"properties": {
"elements": {
"description": "The elements to order by, in priority order",
"type": "array",
"items": {
"$ref": "#/definitions/GroupOrderByElement"
}
}
}
},
"GroupOrderByElement": {
"title": "Group Order By Element",
"type": "object",
"required": [
"order_direction",
"target"
],
"properties": {
"order_direction": {
"$ref": "#/definitions/OrderDirection"
},
"target": {
"$ref": "#/definitions/GroupOrderByTarget"
}
}
},
"GroupOrderByTarget": {
"title": "Group Order By Target",
"oneOf": [
{
"type": "object",
"required": [
"index",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"dimension"
]
},
"index": {
"description": "The index of the dimension to order by, selected from the dimensions provided in the `Grouping` request.",
"type": "integer",
"format": "uint",
"minimum": 0.0
}
}
},
{
"type": "object",
"required": [
"aggregate",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"aggregate": {
"description": "Aggregation method to apply",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"Grouping": {
"title": "Grouping",
"type": "object",
"required": [
"aggregates",
"dimensions"
],
"properties": {
"dimensions": {
"description": "Dimensions along which to partition the data",
"type": "array",
"items": {
"$ref": "#/definitions/Dimension"
}
},
"aggregates": {
"description": "Aggregates to compute in each group",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Aggregate"
}
},
"predicate": {
"description": "Optionally specify a predicate to apply after grouping rows. Only used if the 'query.aggregates.group_by.filter' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/GroupExpression"
},
{
"type": "null"
}
]
},
"order_by": {
"description": "Optionally specify how groups should be ordered Only used if the 'query.aggregates.group_by.order' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/GroupOrderBy"
},
{
"type": "null"
}
]
},
"limit": {
"description": "Optionally limit to N groups Only used if the 'query.aggregates.group_by.paginate' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"offset": {
"description": "Optionally offset from the Nth group Only used if the 'query.aggregates.group_by.paginate' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
}
}
},
"NestedField": {
"title": "NestedField",
"oneOf": [
{
"title": "NestedObject",
"type": "object",
"required": [
"fields",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"object"
]
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Field"
}
}
}
},
{
"title": "NestedArray",
"type": "object",
"required": [
"fields",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"array"
]
},
"fields": {
"$ref": "#/definitions/NestedField"
}
}
},
{
"title": "NestedCollection",
"description": "Perform a query over the nested array's rows. Only used if the 'query.nested_fields.nested_collections' capability is supported.",
"type": "object",
"required": [
"query",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"collection"
]
},
"query": {
"$ref": "#/definitions/Query"
}
}
}
]
},
"OrderBy": {
"title": "Order By",
"type": "object",
"required": [
"elements"
],
"properties": {
"elements": {
"description": "The elements to order by, in priority order",
"type": "array",
"items": {
"$ref": "#/definitions/OrderByElement"
}
}
}
},
"OrderByElement": {
"title": "Order By Element",
"type": "object",
"required": [
"order_direction",
"target"
],
"properties": {
"order_direction": {
"$ref": "#/definitions/OrderDirection"
},
"target": {
"$ref": "#/definitions/OrderByTarget"
}
}
},
"OrderByTarget": {
"title": "Order By Target",
"oneOf": [
{
"description": "The ordering is performed over a column.",
"type": "object",
"required": [
"name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any (object) relationships to traverse to reach this column. Only non-empty if the 'relationships' capability is supported. 'PathElement.field_path' will only be non-empty if the 'relationships.nested.ordering' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.order_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
}
},
{
"description": "The ordering is performed over the result of an aggregation. Only used if the 'relationships.order_by_aggregate' capability is supported.",
"type": "object",
"required": [
"aggregate",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"path": {
"description": "Non-empty collection of relationships to traverse. Only non-empty if the 'relationships' capability is supported. 'PathElement.field_path' will only be non-empty if the 'relationships.nested.ordering' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"aggregate": {
"description": "The aggregation method to use",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"OrderDirection": {
"title": "Order Direction",
"type": "string",
"enum": [
"asc",
"desc"
]
},
"PathElement": {
"title": "Path Element",
"type": "object",
"required": [
"arguments",
"relationship"
],
"properties": {
"field_path": {
"description": "Path to a nested field within an object column that must be navigated before the relationship is navigated. Only non-empty if the 'relationships.nested' capability is supported (plus perhaps one of the sub-capabilities, depending on the feature using the PathElement).",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"relationship": {
"description": "The name of the relationship to follow",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
},
"predicate": {
"description": "A predicate expression to apply to the target collection",
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
}
}
},
"Query": {
"title": "Query",
"type": "object",
"properties": {
"aggregates": {
"description": "Aggregate fields of the query. Only used if the 'query.aggregates' capability is supported.",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/Aggregate"
}
},
"fields": {
"description": "Fields of the query",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/Field"
}
},
"limit": {
"description": "Optionally limit to N results",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"offset": {
"description": "Optionally offset from the Nth result",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"order_by": {
"description": "Optionally specify how rows should be ordered",
"anyOf": [
{
"$ref": "#/definitions/OrderBy"
},
{
"type": "null"
}
]
},
"predicate": {
"description": "Optionally specify a predicate to apply to the rows",
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
},
"groups": {
"description": "Optionally group and aggregate the selected rows. Only used if the 'query.aggregates.group_by' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/Grouping"
},
{
"type": "null"
}
]
}
}
},
"Relationship": {
"title": "Relationship",
"type": "object",
"required": [
"arguments",
"column_mapping",
"relationship_type",
"target_collection"
],
"properties": {
"column_mapping": {
"description": "A mapping between columns on the source row to columns on the target collection. The column on the target collection is specified via a field path (ie. an array of field names that descend through nested object fields). The field path will only contain a single item, meaning a column on the target collection's type, unless the 'relationships.nested' capability is supported, in which case multiple items denotes a nested object field.",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"relationship_type": {
"$ref": "#/definitions/RelationshipType"
},
"target_collection": {
"description": "The name of a collection",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
"RelationshipArgument": {
"title": "Relationship Argument",
"oneOf": [
{
"description": "The argument is provided by reference to a variable. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
},
{
"description": "The argument is provided as a literal value",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"literal"
]
},
"value": true
}
},
{
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"name": {
"type": "string"
}
}
}
]
},
"RelationshipType": {
"title": "Relationship Type",
"type": "string",
"enum": [
"object",
"array"
]
},
"UnaryComparisonOperator": {
"title": "Unary Comparison Operator",
"type": "string",
"enum": [
"is_null"
]
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Query Response",
"description": "Query responses may return multiple RowSets when using queries with variables. Else, there should always be exactly one RowSet",
"type": "array",
"items": {
"$ref": "#/definitions/RowSet"
},
"definitions": {
"Group": {
"title": "Group",
"type": "object",
"required": [
"aggregates",
"dimensions"
],
"properties": {
"dimensions": {
"description": "Values of dimensions which identify this group",
"type": "array",
"items": true
},
"aggregates": {
"description": "Aggregates computed within this group",
"type": "object",
"additionalProperties": true
}
}
},
"RowFieldValue": {
"title": "Row Field Value"
},
"RowSet": {
"title": "Row Set",
"type": "object",
"properties": {
"aggregates": {
"description": "The results of the aggregates returned by the query",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"rows": {
"description": "The rows returned by the query, corresponding to the query's fields",
"type": [
"array",
"null"
],
"items": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RowFieldValue"
}
}
},
"groups": {
"description": "The results of any grouping operation",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Group"
}
}
}
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Query Request",
"description": "This is the request body of the query POST endpoint",
"type": "object",
"required": [
"arguments",
"collection",
"collection_relationships",
"query"
],
"properties": {
"collection": {
"description": "The name of a collection",
"type": "string"
},
"query": {
"description": "The query syntax tree",
"allOf": [
{
"$ref": "#/definitions/Query"
}
]
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"collection_relationships": {
"description": "Any relationships between collections involved in the query request. Only used if the 'relationships' capability is supported.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Relationship"
}
},
"variables": {
"description": "One set of named variables for each rowset to fetch. Each variable set should be subtituted in turn, and a fresh set of rows returned. Only used if the 'query.variables' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "object",
"additionalProperties": true
}
}
},
"definitions": {
"Aggregate": {
"title": "Aggregate",
"oneOf": [
{
"type": "object",
"required": [
"column",
"distinct",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column_count"
]
},
"column": {
"description": "The column to apply the count aggregate function to",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"distinct": {
"description": "Whether or not only distinct items should be counted",
"type": "boolean"
}
}
},
{
"type": "object",
"required": [
"column",
"function",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"single_column"
]
},
"column": {
"description": "The column to apply the aggregation function to",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"function": {
"description": "Single column aggregate function name.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"star_count"
]
}
}
}
]
},
"Argument": {
"title": "Argument",
"oneOf": [
{
"description": "The argument is provided by reference to a variable. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
},
{
"description": "The argument is provided as a literal value",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"literal"
]
},
"value": true
}
}
]
},
"ArrayComparison": {
"title": "Array Comparison",
"oneOf": [
{
"description": "Check if the array contains the specified value. Only used if the 'query.nested_fields.filter_by.nested_arrays.contains' capability is supported.",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"contains"
]
},
"value": {
"$ref": "#/definitions/ComparisonValue"
}
}
},
{
"description": "Check is the array is empty. Only used if the 'query.nested_fields.filter_by.nested_arrays.is_empty' capability is supported.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"is_empty"
]
}
}
}
]
},
"ComparisonTarget": {
"title": "Comparison Target",
"oneOf": [
{
"description": "The comparison targets a column.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.filter_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
}
},
{
"description": "The comparison targets the result of aggregation. Only used if the 'query.aggregates.filter_by' capability is supported.",
"type": "object",
"required": [
"aggregate",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"path": {
"description": "Non-empty collection of relationships to traverse",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"aggregate": {
"description": "The aggregation method to use",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"ComparisonValue": {
"title": "Comparison Value",
"oneOf": [
{
"description": "The value to compare against should be drawn from another column",
"type": "object",
"required": [
"name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any relationships to traverse to reach this column. Only non-empty if the 'relationships.relation_comparisons' is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.filter_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"scope": {
"description": "The scope in which this column exists, identified by an top-down index into the stack of scopes. The stack grows inside each `Expression::Exists`, so scope 0 (the default) refers to the current collection, and each subsequent index refers to the collection outside its predecessor's immediately enclosing `Expression::Exists` expression. Only used if the 'query.exists.named_scopes' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0.0
}
}
},
{
"description": "A scalar value to compare against",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"scalar"
]
},
"value": true
}
},
{
"description": "A value to compare against that is to be drawn from the query's variables. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
}
]
},
"Dimension": {
"title": "Dimension",
"oneOf": [
{
"type": "object",
"required": [
"column_name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any (object) relationships to traverse to reach this column. Only non-empty if the 'relationships' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"column_name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'column_name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"extraction": {
"description": "The name of the extraction function to apply to the selected value, if any",
"type": [
"string",
"null"
]
}
}
}
]
},
"ExistsInCollection": {
"title": "Exists In Collection",
"oneOf": [
{
"description": "The rows to evaluate the exists predicate against come from a related collection. Only used if the 'relationships' capability is supported.",
"type": "object",
"required": [
"arguments",
"relationship",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"related"
]
},
"field_path": {
"description": "Path to a nested field within an object column that must be navigated before the relationship is navigated. Only non-empty if the 'relationships.nested.filtering' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"relationship": {
"description": "The name of the relationship to follow",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
{
"description": "The rows to evaluate the exists predicate against come from an unrelated collection Only used if the 'query.exists.unrelated' capability is supported.",
"type": "object",
"required": [
"arguments",
"collection",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unrelated"
]
},
"collection": {
"description": "The name of a collection",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
{
"description": "The rows to evaluate the exists predicate against come from a nested array field. Only used if the 'query.exists.nested_collections' capability is supported.",
"type": "object",
"required": [
"column_name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nested_collection"
]
},
"column_name": {
"type": "string"
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested collection via object columns",
"type": "array",
"items": {
"type": "string"
}
}
}
},
{
"description": "Specifies a column that contains a nested array of scalars. The array will be brought into scope of the nested expression where each element becomes an object with one '__value' column that contains the element value. Only used if the 'query.exists.nested_scalar_collections' capability is supported.",
"type": "object",
"required": [
"column_name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nested_scalar_collection"
]
},
"column_name": {
"type": "string"
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested collection via object columns",
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
},
"Expression": {
"title": "Expression",
"oneOf": [
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"and"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/Expression"
}
}
}
},
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"or"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/Expression"
}
}
}
},
{
"type": "object",
"required": [
"expression",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"not"
]
},
"expression": {
"$ref": "#/definitions/Expression"
}
}
},
{
"type": "object",
"required": [
"column",
"operator",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unary_comparison_operator"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"operator": {
"$ref": "#/definitions/UnaryComparisonOperator"
}
}
},
{
"type": "object",
"required": [
"column",
"operator",
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"binary_comparison_operator"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"operator": {
"type": "string"
},
"value": {
"$ref": "#/definitions/ComparisonValue"
}
}
},
{
"description": "A comparison against a nested array column. Only used if the 'query.nested_fields.filter_by.nested_arrays' capability is supported.",
"type": "object",
"required": [
"column",
"comparison",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"array_comparison"
]
},
"column": {
"$ref": "#/definitions/ComparisonTarget"
},
"comparison": {
"$ref": "#/definitions/ArrayComparison"
}
}
},
{
"type": "object",
"required": [
"in_collection",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"exists"
]
},
"in_collection": {
"$ref": "#/definitions/ExistsInCollection"
},
"predicate": {
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
}
}
}
]
},
"Field": {
"title": "Field",
"oneOf": [
{
"description": "A field satisfied by returning the value of a row's column.",
"type": "object",
"required": [
"column",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"column": {
"type": "string"
},
"fields": {
"description": "When the type of the column is a (possibly-nullable) array or object, the caller can request a subset of the complete column data, by specifying fields to fetch here. If omitted, the column data will be fetched in full.",
"anyOf": [
{
"$ref": "#/definitions/NestedField"
},
{
"type": "null"
}
]
},
"arguments": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
}
}
},
{
"description": "A field satisfied by navigating a relationship from the current row to a related collection. Only used if the 'relationships' capability is supported.",
"type": "object",
"required": [
"arguments",
"query",
"relationship",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"relationship"
]
},
"query": {
"$ref": "#/definitions/Query"
},
"relationship": {
"description": "The name of the relationship to follow for the subquery",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
}
]
},
"GroupComparisonTarget": {
"title": "Aggregate Comparison Target",
"oneOf": [
{
"type": "object",
"required": [
"aggregate",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"aggregate": {
"$ref": "#/definitions/Aggregate"
}
}
}
]
},
"GroupComparisonValue": {
"title": "Aggregate Comparison Value",
"oneOf": [
{
"description": "A scalar value to compare against",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"scalar"
]
},
"value": true
}
},
{
"description": "A value to compare against that is to be drawn from the query's variables. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
}
]
},
"GroupExpression": {
"title": "Group Expression",
"oneOf": [
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"and"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/GroupExpression"
}
}
}
},
{
"type": "object",
"required": [
"expressions",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"or"
]
},
"expressions": {
"type": "array",
"items": {
"$ref": "#/definitions/GroupExpression"
}
}
}
},
{
"type": "object",
"required": [
"expression",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"not"
]
},
"expression": {
"$ref": "#/definitions/GroupExpression"
}
}
},
{
"type": "object",
"required": [
"operator",
"target",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"unary_comparison_operator"
]
},
"target": {
"$ref": "#/definitions/GroupComparisonTarget"
},
"operator": {
"$ref": "#/definitions/UnaryComparisonOperator"
}
}
},
{
"type": "object",
"required": [
"operator",
"target",
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"binary_comparison_operator"
]
},
"target": {
"$ref": "#/definitions/GroupComparisonTarget"
},
"operator": {
"type": "string"
},
"value": {
"$ref": "#/definitions/GroupComparisonValue"
}
}
}
]
},
"GroupOrderBy": {
"title": "Group Order By",
"type": "object",
"required": [
"elements"
],
"properties": {
"elements": {
"description": "The elements to order by, in priority order",
"type": "array",
"items": {
"$ref": "#/definitions/GroupOrderByElement"
}
}
}
},
"GroupOrderByElement": {
"title": "Group Order By Element",
"type": "object",
"required": [
"order_direction",
"target"
],
"properties": {
"order_direction": {
"$ref": "#/definitions/OrderDirection"
},
"target": {
"$ref": "#/definitions/GroupOrderByTarget"
}
}
},
"GroupOrderByTarget": {
"title": "Group Order By Target",
"oneOf": [
{
"type": "object",
"required": [
"index",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"dimension"
]
},
"index": {
"description": "The index of the dimension to order by, selected from the dimensions provided in the `Grouping` request.",
"type": "integer",
"format": "uint",
"minimum": 0.0
}
}
},
{
"type": "object",
"required": [
"aggregate",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"aggregate": {
"description": "Aggregation method to apply",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"Grouping": {
"title": "Grouping",
"type": "object",
"required": [
"aggregates",
"dimensions"
],
"properties": {
"dimensions": {
"description": "Dimensions along which to partition the data",
"type": "array",
"items": {
"$ref": "#/definitions/Dimension"
}
},
"aggregates": {
"description": "Aggregates to compute in each group",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Aggregate"
}
},
"predicate": {
"description": "Optionally specify a predicate to apply after grouping rows. Only used if the 'query.aggregates.group_by.filter' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/GroupExpression"
},
{
"type": "null"
}
]
},
"order_by": {
"description": "Optionally specify how groups should be ordered Only used if the 'query.aggregates.group_by.order' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/GroupOrderBy"
},
{
"type": "null"
}
]
},
"limit": {
"description": "Optionally limit to N groups Only used if the 'query.aggregates.group_by.paginate' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"offset": {
"description": "Optionally offset from the Nth group Only used if the 'query.aggregates.group_by.paginate' capability is supported.",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
}
}
},
"NestedField": {
"title": "NestedField",
"oneOf": [
{
"title": "NestedObject",
"type": "object",
"required": [
"fields",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"object"
]
},
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Field"
}
}
}
},
{
"title": "NestedArray",
"type": "object",
"required": [
"fields",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"array"
]
},
"fields": {
"$ref": "#/definitions/NestedField"
}
}
},
{
"title": "NestedCollection",
"description": "Perform a query over the nested array's rows. Only used if the 'query.nested_fields.nested_collections' capability is supported.",
"type": "object",
"required": [
"query",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"collection"
]
},
"query": {
"$ref": "#/definitions/Query"
}
}
}
]
},
"OrderBy": {
"title": "Order By",
"type": "object",
"required": [
"elements"
],
"properties": {
"elements": {
"description": "The elements to order by, in priority order",
"type": "array",
"items": {
"$ref": "#/definitions/OrderByElement"
}
}
}
},
"OrderByElement": {
"title": "Order By Element",
"type": "object",
"required": [
"order_direction",
"target"
],
"properties": {
"order_direction": {
"$ref": "#/definitions/OrderDirection"
},
"target": {
"$ref": "#/definitions/OrderByTarget"
}
}
},
"OrderByTarget": {
"title": "Order By Target",
"oneOf": [
{
"description": "The ordering is performed over a column.",
"type": "object",
"required": [
"name",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"path": {
"description": "Any (object) relationships to traverse to reach this column. Only non-empty if the 'relationships' capability is supported. 'PathElement.field_path' will only be non-empty if the 'relationships.nested.ordering' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"name": {
"description": "The name of the column",
"type": "string"
},
"arguments": {
"description": "Arguments to satisfy the column specified by 'name'",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Argument"
}
},
"field_path": {
"description": "Path to a nested field within an object column. Only non-empty if the 'query.nested_fields.order_by' capability is supported.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
}
}
},
{
"description": "The ordering is performed over the result of an aggregation. Only used if the 'relationships.order_by_aggregate' capability is supported.",
"type": "object",
"required": [
"aggregate",
"path",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"aggregate"
]
},
"path": {
"description": "Non-empty collection of relationships to traverse. Only non-empty if the 'relationships' capability is supported. 'PathElement.field_path' will only be non-empty if the 'relationships.nested.ordering' capability is supported.",
"type": "array",
"items": {
"$ref": "#/definitions/PathElement"
}
},
"aggregate": {
"description": "The aggregation method to use",
"allOf": [
{
"$ref": "#/definitions/Aggregate"
}
]
}
}
}
]
},
"OrderDirection": {
"title": "Order Direction",
"type": "string",
"enum": [
"asc",
"desc"
]
},
"PathElement": {
"title": "Path Element",
"type": "object",
"required": [
"arguments",
"relationship"
],
"properties": {
"field_path": {
"description": "Path to a nested field within an object column that must be navigated before the relationship is navigated. Only non-empty if the 'relationships.nested' capability is supported (plus perhaps one of the sub-capabilities, depending on the feature using the PathElement).",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"relationship": {
"description": "The name of the relationship to follow",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
},
"predicate": {
"description": "A predicate expression to apply to the target collection",
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
}
}
},
"Query": {
"title": "Query",
"type": "object",
"properties": {
"aggregates": {
"description": "Aggregate fields of the query. Only used if the 'query.aggregates' capability is supported.",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/Aggregate"
}
},
"fields": {
"description": "Fields of the query",
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/Field"
}
},
"limit": {
"description": "Optionally limit to N results",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"offset": {
"description": "Optionally offset from the Nth result",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
},
"order_by": {
"description": "Optionally specify how rows should be ordered",
"anyOf": [
{
"$ref": "#/definitions/OrderBy"
},
{
"type": "null"
}
]
},
"predicate": {
"description": "Optionally specify a predicate to apply to the rows",
"anyOf": [
{
"$ref": "#/definitions/Expression"
},
{
"type": "null"
}
]
},
"groups": {
"description": "Optionally group and aggregate the selected rows. Only used if the 'query.aggregates.group_by' capability is supported.",
"anyOf": [
{
"$ref": "#/definitions/Grouping"
},
{
"type": "null"
}
]
}
}
},
"Relationship": {
"title": "Relationship",
"type": "object",
"required": [
"arguments",
"column_mapping",
"relationship_type",
"target_collection"
],
"properties": {
"column_mapping": {
"description": "A mapping between columns on the source row to columns on the target collection. The column on the target collection is specified via a field path (ie. an array of field names that descend through nested object fields). The field path will only contain a single item, meaning a column on the target collection's type, unless the 'relationships.nested' capability is supported, in which case multiple items denotes a nested object field.",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"relationship_type": {
"$ref": "#/definitions/RelationshipType"
},
"target_collection": {
"description": "The name of a collection",
"type": "string"
},
"arguments": {
"description": "Values to be provided to any collection arguments",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/RelationshipArgument"
}
}
}
},
"RelationshipArgument": {
"title": "Relationship Argument",
"oneOf": [
{
"description": "The argument is provided by reference to a variable. Only used if the 'query.variables' capability is supported.",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"variable"
]
},
"name": {
"type": "string"
}
}
},
{
"description": "The argument is provided as a literal value",
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"literal"
]
},
"value": true
}
},
{
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"column"
]
},
"name": {
"type": "string"
}
}
}
]
},
"RelationshipType": {
"title": "Relationship Type",
"type": "string",
"enum": [
"object",
"array"
]
},
"UnaryComparisonOperator": {
"title": "Unary Comparison Operator",
"type": "string",
"enum": [
"is_null"
]
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Schema Response",
"type": "object",
"required": [
"collections",
"functions",
"object_types",
"procedures",
"scalar_types"
],
"properties": {
"scalar_types": {
"description": "A list of scalar types which will be used as the types of collection columns",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ScalarType"
}
},
"object_types": {
"description": "A list of object types which can be used as the types of arguments, or return types of procedures. Names should not overlap with scalar type names.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ObjectType"
}
},
"collections": {
"description": "Collections which are available for queries",
"type": "array",
"items": {
"$ref": "#/definitions/CollectionInfo"
}
},
"functions": {
"description": "Functions (i.e. collections which return a single column and row)",
"type": "array",
"items": {
"$ref": "#/definitions/FunctionInfo"
}
},
"procedures": {
"description": "Procedures which are available for execution as part of mutations",
"type": "array",
"items": {
"$ref": "#/definitions/ProcedureInfo"
}
},
"capabilities": {
"description": "Schema data which is relevant to features enabled by capabilities",
"anyOf": [
{
"$ref": "#/definitions/CapabilitySchemaInfo"
},
{
"type": "null"
}
]
}
},
"definitions": {
"AggregateCapabilitiesSchemaInfo": {
"title": "Aggregate Capabilities Schema Info",
"type": "object",
"required": [
"count_scalar_type"
],
"properties": {
"count_scalar_type": {
"description": "The scalar type which should be used for the return type of count (star_count and column_count) operations.",
"type": "string"
}
}
},
"AggregateFunctionDefinition": {
"title": "Aggregate Function Definition",
"description": "The definition of an aggregation function on a scalar type",
"oneOf": [
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"min"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"max"
]
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"sum"
]
},
"result_type": {
"description": "The scalar type of the result of this function, which should have one of the type representations Int64 or Float64, depending on whether this function is defined on a scalar type with an integer or floating-point representation, respectively.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"average"
]
},
"result_type": {
"description": "The scalar type of the result of this function, which should have the type representation Float64",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"custom"
]
},
"result_type": {
"description": "The scalar or object type of the result of this function",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
}
]
},
"ArgumentInfo": {
"title": "Argument Info",
"type": "object",
"required": [
"type"
],
"properties": {
"description": {
"description": "Argument description",
"type": [
"string",
"null"
]
},
"type": {
"description": "The name of the type of this argument",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
"CapabilitySchemaInfo": {
"title": "Capability Schema Info",
"type": "object",
"properties": {
"query": {
"description": "Schema information relevant to query capabilities",
"anyOf": [
{
"$ref": "#/definitions/QueryCapabilitiesSchemaInfo"
},
{
"type": "null"
}
]
}
}
},
"CollectionInfo": {
"title": "Collection Info",
"type": "object",
"required": [
"arguments",
"name",
"type",
"uniqueness_constraints"
],
"properties": {
"name": {
"description": "The name of the collection\n\nNote: these names are abstract - there is no requirement that this name correspond to the name of an actual collection in the database.",
"type": "string"
},
"description": {
"description": "Description of the collection",
"type": [
"string",
"null"
]
},
"arguments": {
"description": "Any arguments that this collection requires",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ArgumentInfo"
}
},
"type": {
"description": "The name of the collection's object type",
"type": "string"
},
"uniqueness_constraints": {
"description": "Any uniqueness constraints enforced on this collection",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/UniquenessConstraint"
}
}
}
},
"ComparisonOperatorDefinition": {
"title": "Comparison Operator Definition",
"description": "The definition of a comparison operator on a scalar type",
"oneOf": [
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"equal"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"in"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"less_than"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"less_than_or_equal"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"greater_than"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"greater_than_or_equal"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"contains"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"contains_insensitive"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"starts_with"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"starts_with_insensitive"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ends_with"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ends_with_insensitive"
]
}
}
},
{
"type": "object",
"required": [
"argument_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"custom"
]
},
"argument_type": {
"description": "The type of the argument to this operator",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
}
]
},
"ExtractionFunctionDefinition": {
"title": "Extraction Function Definition",
"description": "The definition of an aggregation function on a scalar type",
"oneOf": [
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nanosecond"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"microsecond"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"second"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"minute"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"hour"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"day"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"week"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"month"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"quarter"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"year"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"day_of_week"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"day_of_year"
]
},
"result_type": {
"description": "The result type, which must be a defined scalar type in the schema response.",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"result_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"custom"
]
},
"result_type": {
"description": "The scalar or object type of the result of this function",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
}
]
},
"ForeignKeyConstraint": {
"title": "Foreign Key Constraint",
"type": "object",
"required": [
"column_mapping",
"foreign_collection"
],
"properties": {
"column_mapping": {
"description": "The columns on which you want want to define the foreign key. This is a mapping between fields on object type to columns on the foreign collection. The column on the foreign collection is specified via a field path (ie. an array of field names that descend through nested object fields). The field path must only contain a single item, meaning a column on the foreign collection's type, unless the 'relationships.nested' capability is supported, in which case multiple items can be used to denote a nested object field.",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"foreign_collection": {
"description": "The name of a collection",
"type": "string"
}
}
},
"FunctionInfo": {
"title": "Function Info",
"type": "object",
"required": [
"arguments",
"name",
"result_type"
],
"properties": {
"name": {
"description": "The name of the function",
"type": "string"
},
"description": {
"description": "Description of the function",
"type": [
"string",
"null"
]
},
"arguments": {
"description": "Any arguments that this collection requires",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ArgumentInfo"
}
},
"result_type": {
"description": "The name of the function's result type",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
"ObjectField": {
"title": "Object Field",
"description": "The definition of an object field",
"type": "object",
"required": [
"type"
],
"properties": {
"description": {
"description": "Description of this field",
"type": [
"string",
"null"
]
},
"type": {
"description": "The type of this field",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
},
"arguments": {
"description": "The arguments available to the field - Matches implementation from CollectionInfo",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ArgumentInfo"
}
}
}
},
"ObjectType": {
"title": "Object Type",
"description": "The definition of an object type",
"type": "object",
"required": [
"fields",
"foreign_keys"
],
"properties": {
"description": {
"description": "Description of this type",
"type": [
"string",
"null"
]
},
"fields": {
"description": "Fields defined on this object type",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ObjectField"
}
},
"foreign_keys": {
"description": "Any foreign keys defined for this object type's columns",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ForeignKeyConstraint"
}
}
}
},
"ProcedureInfo": {
"title": "Procedure Info",
"type": "object",
"required": [
"arguments",
"name",
"result_type"
],
"properties": {
"name": {
"description": "The name of the procedure",
"type": "string"
},
"description": {
"description": "Column description",
"type": [
"string",
"null"
]
},
"arguments": {
"description": "Any arguments that this collection requires",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ArgumentInfo"
}
},
"result_type": {
"description": "The name of the result type",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
"QueryCapabilitiesSchemaInfo": {
"title": "Query Capabilities Schema Info",
"type": "object",
"properties": {
"aggregates": {
"description": "Schema information relevant to aggregate query capabilities",
"anyOf": [
{
"$ref": "#/definitions/AggregateCapabilitiesSchemaInfo"
},
{
"type": "null"
}
]
}
}
},
"ScalarType": {
"title": "Scalar Type",
"description": "The definition of a scalar type, i.e. types that can be used as the types of columns.",
"type": "object",
"required": [
"aggregate_functions",
"comparison_operators",
"representation"
],
"properties": {
"representation": {
"description": "A description of valid values for this scalar type.",
"allOf": [
{
"$ref": "#/definitions/TypeRepresentation"
}
]
},
"aggregate_functions": {
"description": "A map from aggregate function names to their definitions. Result type names must be defined scalar types declared in ScalarTypesCapabilities.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/AggregateFunctionDefinition"
}
},
"comparison_operators": {
"description": "A map from comparison operator names to their definitions. Argument type names must be defined scalar types declared in ScalarTypesCapabilities.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ComparisonOperatorDefinition"
}
},
"extraction_functions": {
"description": "A map from extraction function names to their definitions.",
"default": {},
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ExtractionFunctionDefinition"
}
}
}
},
"Type": {
"title": "Type",
"description": "Types track the valid representations of values as JSON",
"oneOf": [
{
"description": "A named type",
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"named"
]
},
"name": {
"description": "The name can refer to a scalar or object type",
"type": "string"
}
}
},
{
"description": "A nullable type",
"type": "object",
"required": [
"type",
"underlying_type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"nullable"
]
},
"underlying_type": {
"description": "The type of the non-null inhabitants of this type",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
{
"description": "An array type",
"type": "object",
"required": [
"element_type",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"array"
]
},
"element_type": {
"description": "The type of the elements of the array",
"allOf": [
{
"$ref": "#/definitions/Type"
}
]
}
}
},
{
"description": "A predicate type for a given object type",
"type": "object",
"required": [
"object_type_name",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"predicate"
]
},
"object_type_name": {
"description": "The object type name",
"type": "string"
}
}
}
]
},
"TypeRepresentation": {
"title": "Type Representation",
"description": "Representations of scalar types",
"oneOf": [
{
"description": "JSON booleans",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"boolean"
]
}
}
},
{
"description": "Any JSON string",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
}
}
},
{
"description": "A 8-bit signed integer with a minimum value of -2^7 and a maximum value of 2^7 - 1",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"int8"
]
}
}
},
{
"description": "A 16-bit signed integer with a minimum value of -2^15 and a maximum value of 2^15 - 1",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"int16"
]
}
}
},
{
"description": "A 32-bit signed integer with a minimum value of -2^31 and a maximum value of 2^31 - 1",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"int32"
]
}
}
},
{
"description": "A 64-bit signed integer with a minimum value of -2^63 and a maximum value of 2^63 - 1",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"int64"
]
}
}
},
{
"description": "An IEEE-754 single-precision floating-point number",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"float32"
]
}
}
},
{
"description": "An IEEE-754 double-precision floating-point number",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"float64"
]
}
}
},
{
"description": "Arbitrary-precision integer string",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"biginteger"
]
}
}
},
{
"description": "Arbitrary-precision decimal string",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"bigdecimal"
]
}
}
},
{
"description": "UUID string (8-4-4-4-12)",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"uuid"
]
}
}
},
{
"description": "ISO 8601 date",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"date"
]
}
}
},
{
"description": "ISO 8601 timestamp",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"timestamp"
]
}
}
},
{
"description": "ISO 8601 timestamp-with-timezone",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"timestamptz"
]
}
}
},
{
"description": "GeoJSON, per RFC 7946",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"geography"
]
}
}
},
{
"description": "GeoJSON Geometry object, per RFC 7946",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"geometry"
]
}
}
},
{
"description": "Base64-encoded bytes",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"bytes"
]
}
}
},
{
"description": "Arbitrary JSON",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"json"
]
}
}
},
{
"description": "One of the specified string values",
"type": "object",
"required": [
"one_of",
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"enum"
]
},
"one_of": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
},
"UniquenessConstraint": {
"title": "Uniqueness Constraint",
"type": "object",
"required": [
"unique_columns"
],
"properties": {
"unique_columns": {
"description": "A list of columns which this constraint requires to be unique",
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}