diff --git a/swagger.json b/swagger.json index 7b6ceed..3f5212f 100644 --- a/swagger.json +++ b/swagger.json @@ -1160,6 +1160,23 @@ "required": ["results", "status"], "type": "object" }, + "ApiSegmentDimensionsResponse": { + "properties": { + "results": { + "items": { + "$ref": "#/components/schemas/CompiledDimension" + }, + "type": "array" + }, + "status": { + "type": "string", + "enum": ["ok"], + "nullable": false + } + }, + "required": ["results", "status"], + "type": "object" + }, "ApiSuccessEmpty": { "properties": { "results": {}, @@ -4280,6 +4297,110 @@ "UpdateDBProjectGroupAccess": { "$ref": "#/components/schemas/Pick_DBProjectGroupAccess.role_" }, + "Dimension": { + "properties": { + "fieldType": { + "$ref": "#/components/schemas/FieldType.DIMENSION" + }, + "type": { + "$ref": "#/components/schemas/DimensionType" + }, + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "table": { + "type": "string" + }, + "tableLabel": { + "type": "string" + }, + "sql": { + "type": "string" + }, + "description": { + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/Source" + }, + "hidden": { + "type": "boolean" + }, + "compact": { + "$ref": "#/components/schemas/CompactOrAlias" + }, + "round": { + "type": "number", + "format": "double" + }, + "format": { + "$ref": "#/components/schemas/Format" + }, + "groupLabel": { + "type": "string", + "deprecated": true + }, + "groups": { + "items": { + "type": "string" + }, + "type": "array" + }, + "urls": { + "items": { + "$ref": "#/components/schemas/FieldUrl" + }, + "type": "array" + }, + "index": { + "type": "number", + "format": "double" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "group": { + "type": "string", + "deprecated": true + }, + "requiredAttributes": { + "$ref": "#/components/schemas/Record_string.string-or-string-Array_" + }, + "timeInterval": { + "$ref": "#/components/schemas/TimeFrames" + }, + "timeIntervalBaseDimensionName": { + "type": "string" + }, + "isAdditionalDimension": { + "type": "boolean" + }, + "colors": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "isIntervalBase": { + "type": "boolean" + } + }, + "required": [ + "fieldType", + "type", + "name", + "label", + "table", + "tableLabel", + "sql", + "hidden" + ], + "type": "object", + "additionalProperties": true + }, "Record_string.Field-or-TableCalculation-or-CustomDimension-or-Metric_": { "properties": {}, "type": "object", @@ -4320,12 +4441,16 @@ "required": ["label", "value"], "type": "object" }, + "segment": { + "type": "string", + "nullable": true + }, "date": { "type": "string", "format": "date-time" } }, - "required": ["compareMetric", "metric", "date"], + "required": ["compareMetric", "metric", "segment", "date"], "type": "object" }, "MetricExploreDataPointWithDateValue": { @@ -4356,14 +4481,33 @@ "fields": { "$ref": "#/components/schemas/ItemsMap" }, + "segmentDimension": { + "allOf": [ + { + "$ref": "#/components/schemas/Dimension" + } + ], + "nullable": true + }, "compareMetric": { - "$ref": "#/components/schemas/MetricWithAssociatedTimeDimension" + "allOf": [ + { + "$ref": "#/components/schemas/MetricWithAssociatedTimeDimension" + } + ], + "nullable": true }, "metric": { "$ref": "#/components/schemas/MetricWithAssociatedTimeDimension" } }, - "required": ["results", "fields", "metric"], + "required": [ + "results", + "fields", + "segmentDimension", + "compareMetric", + "metric" + ], "type": "object" }, "ApiMetricsExplorerQueryResults": { @@ -4408,24 +4552,28 @@ "enum": ["different_metric"], "type": "string" }, - "MetricExplorerComparisonType": { + "MetricExplorerQuery": { "anyOf": [ { "properties": { - "type": { + "segmentDimension": { + "type": "string", + "nullable": true + }, + "comparison": { "$ref": "#/components/schemas/MetricExplorerComparison.NONE" } }, - "required": ["type"], + "required": ["segmentDimension", "comparison"], "type": "object" }, { "properties": { - "type": { + "comparison": { "$ref": "#/components/schemas/MetricExplorerComparison.PREVIOUS_PERIOD" } }, - "required": ["type"], + "required": ["comparison"], "type": "object" }, { @@ -4445,11 +4593,11 @@ "required": ["name", "table", "label"], "type": "object" }, - "type": { + "comparison": { "$ref": "#/components/schemas/MetricExplorerComparison.DIFFERENT_METRIC" } }, - "required": ["metric", "type"], + "required": ["metric", "comparison"], "type": "object" } ] @@ -12227,7 +12375,7 @@ }, "info": { "title": "Lightdash API", - "version": "0.1410.1", + "version": "0.1411.0", "description": "Open API documentation for all public Lightdash API endpoints. # Authentication Before you get started, you might need to create a Personal Access Token to authenticate via the API. You can create a token by following this guide: https://docs.lightdash.com/references/personal_tokens\n", "license": { "name": "MIT" @@ -12693,6 +12841,54 @@ ] } }, + "/api/v1/projects/{projectUuid}/dataCatalog/{tableName}/segment-dimensions": { + "get": { + "operationId": "getSegmentDimensions", + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiSegmentDimensionsResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiErrorPayload" + } + } + } + } + }, + "description": "Get dimensions that can be used to segment metrics", + "tags": ["Catalog"], + "security": [], + "parameters": [ + { + "in": "path", + "name": "projectUuid", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "tableName", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, "/api/v1/projects/{projectUuid}/dataCatalog/{catalogSearchUuid}/categories": { "post": { "operationId": "addCategoryToCatalogItem", @@ -14592,14 +14788,14 @@ "application/json": { "schema": { "properties": { - "comparison": { - "$ref": "#/components/schemas/MetricExplorerComparisonType" + "query": { + "$ref": "#/components/schemas/MetricExplorerQuery" }, "timeDimensionOverride": { "$ref": "#/components/schemas/TimeDimensionConfig" } }, - "required": ["comparison"], + "required": ["query"], "type": "object" } }