From 615fa7a31bcb0217bc9056c5d457df5d03389598 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 15 Dec 2021 11:55:21 -0700 Subject: [PATCH 1/4] feat: add colorMapping property type to the swagger definition --- contracts/cloud-diff.yml | 8 ++++++++ contracts/cloud.json | 15 +++++++++++++++ contracts/cloud.yml | 11 +++++++++++ contracts/common.yml | 11 +++++++++++ contracts/oss-diff.yml | 8 ++++++++ contracts/oss.json | 15 +++++++++++++++ contracts/oss.yml | 11 +++++++++++ contracts/ref/cloud.yml | 12 ++++++++++++ contracts/ref/oss.yml | 12 ++++++++++++ src/common/_schemas.yml | 2 ++ src/common/schemas/ColorMapping.yml | 7 +++++++ src/common/schemas/XYViewProperties.yml | 3 +++ 12 files changed, 115 insertions(+) create mode 100644 src/common/schemas/ColorMapping.yml diff --git a/contracts/cloud-diff.yml b/contracts/cloud-diff.yml index 1577a4b08..98d6857c8 100644 --- a/contracts/cloud-diff.yml +++ b/contracts/cloud-diff.yml @@ -1406,6 +1406,14 @@ paths: type: array items: $ref: '#/paths/~1dashboards/post/responses/201/content/application~1json/schema/oneOf/1/allOf/1/properties/cells/items/allOf/1/properties/properties/oneOf/0/properties/colors/items' + colorMapping: + description: An object that contains information about the color mapping + type: object + additionalProperties: + type: int + example: + series_id_1: 0 + series_id_2: 1 shape: type: string enum: diff --git a/contracts/cloud.json b/contracts/cloud.json index ce6eb0ddf..039921d29 100644 --- a/contracts/cloud.json +++ b/contracts/cloud.json @@ -13533,6 +13533,10 @@ "$ref": "#/components/schemas/DashboardColor" } }, + "colorMapping": { + "description": "An object that contains information about the color mapping", + "$ref": "#/components/schemas/ColorMapping" + }, "shape": { "type": "string", "enum": [ @@ -17384,6 +17388,17 @@ "explicit" ] }, + "ColorMapping": { + "type": "object", + "description": "maps series id to the color index that is used to index into the colors array", + "additionalProperties": { + "type": "int" + }, + "example": { + "series_id_1": 0, + "series_id_2": 1 + } + }, "DemoDataBucket": { "properties": { "links": { diff --git a/contracts/cloud.yml b/contracts/cloud.yml index 21af89d56..b6fe1fef8 100644 --- a/contracts/cloud.yml +++ b/contracts/cloud.yml @@ -8603,6 +8603,9 @@ components: type: array items: $ref: '#/components/schemas/DashboardColor' + colorMapping: + description: An object that contains information about the color mapping + $ref: '#/components/schemas/ColorMapping' shape: type: string enum: @@ -11195,6 +11198,14 @@ components: enum: - implicit - explicit + ColorMapping: + type: object + description: maps series id to the color index that is used to index into the colors array + additionalProperties: + type: int + example: + series_id_1: 0 + series_id_2: 1 DemoDataBucket: properties: links: diff --git a/contracts/common.yml b/contracts/common.yml index c25556053..64285b6b5 100644 --- a/contracts/common.yml +++ b/contracts/common.yml @@ -7271,6 +7271,9 @@ components: type: array items: $ref: '#/components/schemas/DashboardColor' + colorMapping: + description: An object that contains information about the color mapping + $ref: '#/components/schemas/ColorMapping' shape: type: string enum: @@ -9863,6 +9866,14 @@ components: enum: - implicit - explicit + ColorMapping: + type: object + description: maps series id to the color index that is used to index into the colors array + additionalProperties: + type: int + example: + series_id_1: 0 + series_id_2: 1 responses: ServerError: description: Non 2XX error response from server. diff --git a/contracts/oss-diff.yml b/contracts/oss-diff.yml index 7bb4b0a62..271faeaac 100644 --- a/contracts/oss-diff.yml +++ b/contracts/oss-diff.yml @@ -2363,6 +2363,14 @@ paths: type: array items: $ref: '#/paths/~1dashboards/post/responses/201/content/application~1json/schema/oneOf/1/allOf/1/properties/cells/items/allOf/1/properties/properties/oneOf/0/properties/colors/items' + colorMapping: + description: An object that contains information about the color mapping + type: object + additionalProperties: + type: int + example: + series_id_1: 0 + series_id_2: 1 shape: type: string enum: diff --git a/contracts/oss.json b/contracts/oss.json index b86bdaee6..1adf33cf5 100644 --- a/contracts/oss.json +++ b/contracts/oss.json @@ -14858,6 +14858,10 @@ "$ref": "#/components/schemas/DashboardColor" } }, + "colorMapping": { + "description": "An object that contains information about the color mapping", + "$ref": "#/components/schemas/ColorMapping" + }, "shape": { "type": "string", "enum": [ @@ -18709,6 +18713,17 @@ "explicit" ] }, + "ColorMapping": { + "type": "object", + "description": "maps series id to the color index that is used to index into the colors array", + "additionalProperties": { + "type": "int" + }, + "example": { + "series_id_1": 0, + "series_id_2": 1 + } + }, "Authorization": { "required": [ "orgID", diff --git a/contracts/oss.yml b/contracts/oss.yml index de41f6564..7e2d849cf 100644 --- a/contracts/oss.yml +++ b/contracts/oss.yml @@ -9395,6 +9395,9 @@ components: type: array items: $ref: '#/components/schemas/DashboardColor' + colorMapping: + description: An object that contains information about the color mapping + $ref: '#/components/schemas/ColorMapping' shape: type: string enum: @@ -11987,6 +11990,14 @@ components: enum: - implicit - explicit + ColorMapping: + type: object + description: maps series id to the color index that is used to index into the colors array + additionalProperties: + type: int + example: + series_id_1: 0 + series_id_2: 1 Authorization: required: - orgID diff --git a/contracts/ref/cloud.yml b/contracts/ref/cloud.yml index 9eb4554e6..db607aa30 100644 --- a/contracts/ref/cloud.yml +++ b/contracts/ref/cloud.yml @@ -723,6 +723,15 @@ components: type: array links: $ref: '#/components/schemas/Links' + ColorMapping: + additionalProperties: + type: int + description: maps series id to the color index that is used to index into the + colors array + example: + series_id_1: 0 + series_id_2: 1 + type: object ColumnDataType: enum: - integer @@ -5737,6 +5746,9 @@ components: properties: axes: $ref: '#/components/schemas/Axes' + colorMapping: + $ref: '#/components/schemas/ColorMapping' + description: An object that contains information about the color mapping colors: description: Colors define color encoding of data into a visualization items: diff --git a/contracts/ref/oss.yml b/contracts/ref/oss.yml index 6fbb23bf4..4828962d6 100644 --- a/contracts/ref/oss.yml +++ b/contracts/ref/oss.yml @@ -788,6 +788,15 @@ components: type: array links: $ref: '#/components/schemas/Links' + ColorMapping: + additionalProperties: + type: int + description: maps series id to the color index that is used to index into the + colors array + example: + series_id_1: 0 + series_id_2: 1 + type: object ConditionalExpression: description: Selects one of two expressions, `Alternate` or `Consequent`, depending on a third boolean expression, `Test` @@ -5660,6 +5669,9 @@ components: properties: axes: $ref: '#/components/schemas/Axes' + colorMapping: + $ref: '#/components/schemas/ColorMapping' + description: An object that contains information about the color mapping colors: description: Colors define color encoding of data into a visualization items: diff --git a/src/common/_schemas.yml b/src/common/_schemas.yml index b68aa0d65..f2e7c665d 100644 --- a/src/common/_schemas.yml +++ b/src/common/_schemas.yml @@ -446,3 +446,5 @@ $ref: "./common/schemas/DBRPGet.yml" SchemaType: $ref: "./common/schemas/SchemaType.yml" + ColorMapping: + $ref: "./common/schemas/ColorMapping.yml" diff --git a/src/common/schemas/ColorMapping.yml b/src/common/schemas/ColorMapping.yml new file mode 100644 index 000000000..901a68bcc --- /dev/null +++ b/src/common/schemas/ColorMapping.yml @@ -0,0 +1,7 @@ + type: object + description: maps series id to the color index that is used to index into the colors array + additionalProperties: + type: int + example: + series_id_1: 0 + series_id_2: 1 \ No newline at end of file diff --git a/src/common/schemas/XYViewProperties.yml b/src/common/schemas/XYViewProperties.yml index fde5bfa21..00b77c297 100644 --- a/src/common/schemas/XYViewProperties.yml +++ b/src/common/schemas/XYViewProperties.yml @@ -24,6 +24,9 @@ type: array items: $ref: "./DashboardColor.yml" + colorMapping: + description: An object that contains information about the color mapping + $ref: "./ColorMapping.yml" shape: type: string enum: ["chronograf-v2"] From c9d0c5a6a4bb46fad06d9155f716bf01bd04525a Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 15 Dec 2021 11:56:14 -0700 Subject: [PATCH 2/4] fix: lint yaml new line --- src/common/schemas/ColorMapping.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/schemas/ColorMapping.yml b/src/common/schemas/ColorMapping.yml index 901a68bcc..bb7f18611 100644 --- a/src/common/schemas/ColorMapping.yml +++ b/src/common/schemas/ColorMapping.yml @@ -4,4 +4,4 @@ type: int example: series_id_1: 0 - series_id_2: 1 \ No newline at end of file + series_id_2: 1 From b0c3996d233f396166867714563319d8c15b0f23 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Mon, 20 Dec 2021 10:07:26 -0700 Subject: [PATCH 3/4] chore: PR comments, better description and examples --- contracts/cloud-diff.yml | 2 ++ contracts/cloud.json | 6 ++++-- contracts/cloud.yml | 4 +++- contracts/common.yml | 4 +++- contracts/oss-diff.yml | 2 ++ contracts/oss.json | 6 ++++-- contracts/oss.yml | 4 +++- contracts/ref/cloud.yml | 6 ++++-- contracts/ref/oss.yml | 6 ++++-- src/common/schemas/ColorMapping.yml | 4 +++- 10 files changed, 32 insertions(+), 12 deletions(-) diff --git a/contracts/cloud-diff.yml b/contracts/cloud-diff.yml index 281b7a9ce..6a7a8ede0 100644 --- a/contracts/cloud-diff.yml +++ b/contracts/cloud-diff.yml @@ -1414,6 +1414,8 @@ paths: example: series_id_1: 0 series_id_2: 1 + measurement_birdmigration_europe: 0 + configcat_deployments-autopromotionblocker: 0 shape: type: string enum: diff --git a/contracts/cloud.json b/contracts/cloud.json index 5c81c69fa..ed7afab35 100644 --- a/contracts/cloud.json +++ b/contracts/cloud.json @@ -17445,13 +17445,15 @@ }, "ColorMapping": { "type": "object", - "description": "maps series id to the color index that is used to index into the colors array", + "description": "A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads.", "additionalProperties": { "type": "int" }, "example": { "series_id_1": 0, - "series_id_2": 1 + "series_id_2": 1, + "measurement_birdmigration_europe": 0, + "configcat_deployments-autopromotionblocker": 0 } }, "DemoDataBucket": { diff --git a/contracts/cloud.yml b/contracts/cloud.yml index 7688a79d3..158984633 100644 --- a/contracts/cloud.yml +++ b/contracts/cloud.yml @@ -11245,12 +11245,14 @@ components: - explicit ColorMapping: type: object - description: maps series id to the color index that is used to index into the colors array + description: A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads. additionalProperties: type: int example: series_id_1: 0 series_id_2: 1 + measurement_birdmigration_europe: 0 + configcat_deployments-autopromotionblocker: 0 DemoDataBucket: properties: links: diff --git a/contracts/common.yml b/contracts/common.yml index 23bb58f12..64a1a1ead 100644 --- a/contracts/common.yml +++ b/contracts/common.yml @@ -10098,12 +10098,14 @@ components: - explicit ColorMapping: type: object - description: maps series id to the color index that is used to index into the colors array + description: A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads. additionalProperties: type: int example: series_id_1: 0 series_id_2: 1 + measurement_birdmigration_europe: 0 + configcat_deployments-autopromotionblocker: 0 responses: ServerError: description: Non 2XX error response from server. diff --git a/contracts/oss-diff.yml b/contracts/oss-diff.yml index 3889445a5..26b5c2ed8 100644 --- a/contracts/oss-diff.yml +++ b/contracts/oss-diff.yml @@ -2371,6 +2371,8 @@ paths: example: series_id_1: 0 series_id_2: 1 + measurement_birdmigration_europe: 0 + configcat_deployments-autopromotionblocker: 0 shape: type: string enum: diff --git a/contracts/oss.json b/contracts/oss.json index e77d2df33..b1267348b 100644 --- a/contracts/oss.json +++ b/contracts/oss.json @@ -18788,13 +18788,15 @@ }, "ColorMapping": { "type": "object", - "description": "maps series id to the color index that is used to index into the colors array", + "description": "A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads.", "additionalProperties": { "type": "int" }, "example": { "series_id_1": 0, - "series_id_2": 1 + "series_id_2": 1, + "measurement_birdmigration_europe": 0, + "configcat_deployments-autopromotionblocker": 0 } }, "Authorization": { diff --git a/contracts/oss.yml b/contracts/oss.yml index 9d8436451..4789b034f 100644 --- a/contracts/oss.yml +++ b/contracts/oss.yml @@ -12057,12 +12057,14 @@ components: - explicit ColorMapping: type: object - description: maps series id to the color index that is used to index into the colors array + description: A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads. additionalProperties: type: int example: series_id_1: 0 series_id_2: 1 + measurement_birdmigration_europe: 0 + configcat_deployments-autopromotionblocker: 0 Authorization: required: - orgID diff --git a/contracts/ref/cloud.yml b/contracts/ref/cloud.yml index a092c6935..4028f0cb3 100644 --- a/contracts/ref/cloud.yml +++ b/contracts/ref/cloud.yml @@ -726,9 +726,11 @@ components: ColorMapping: additionalProperties: type: int - description: maps series id to the color index that is used to index into the - colors array + description: A color mapping is an object that maps time series data to a UI + color scheme to allow the UI to render graphs consistent colors across reloads. example: + configcat_deployments-autopromotionblocker: 0 + measurement_birdmigration_europe: 0 series_id_1: 0 series_id_2: 1 type: object diff --git a/contracts/ref/oss.yml b/contracts/ref/oss.yml index 2aa84e15f..6942b1b9e 100644 --- a/contracts/ref/oss.yml +++ b/contracts/ref/oss.yml @@ -791,9 +791,11 @@ components: ColorMapping: additionalProperties: type: int - description: maps series id to the color index that is used to index into the - colors array + description: A color mapping is an object that maps time series data to a UI + color scheme to allow the UI to render graphs consistent colors across reloads. example: + configcat_deployments-autopromotionblocker: 0 + measurement_birdmigration_europe: 0 series_id_1: 0 series_id_2: 1 type: object diff --git a/src/common/schemas/ColorMapping.yml b/src/common/schemas/ColorMapping.yml index bb7f18611..b66e9a9a0 100644 --- a/src/common/schemas/ColorMapping.yml +++ b/src/common/schemas/ColorMapping.yml @@ -1,7 +1,9 @@ type: object - description: maps series id to the color index that is used to index into the colors array + description: A color mapping is an object that maps time series data to a UI color scheme to allow the UI to render graphs consistent colors across reloads. additionalProperties: type: int example: series_id_1: 0 series_id_2: 1 + measurement_birdmigration_europe: 0 + configcat_deployments-autopromotionblocker: 0 \ No newline at end of file From 8f9c143a8ab0de9553e4f76414d15700b308c2c6 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Mon, 20 Dec 2021 10:08:04 -0700 Subject: [PATCH 4/4] chore: lint new line --- src/common/schemas/ColorMapping.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/schemas/ColorMapping.yml b/src/common/schemas/ColorMapping.yml index b66e9a9a0..3f63236d1 100644 --- a/src/common/schemas/ColorMapping.yml +++ b/src/common/schemas/ColorMapping.yml @@ -6,4 +6,4 @@ series_id_1: 0 series_id_2: 1 measurement_birdmigration_europe: 0 - configcat_deployments-autopromotionblocker: 0 \ No newline at end of file + configcat_deployments-autopromotionblocker: 0