From 8c0ca7c85efba52c261c3039880fc47da148a7eb Mon Sep 17 00:00:00 2001 From: Jude Hung Date: Tue, 21 Feb 2023 20:27:43 +0800 Subject: [PATCH] fix: Remove extra hyphen out of the core-metadata.yaml Three map[string]any fields are recently added into DTOs: 1. tags field of Device DTO 2. properties field of Device DTO 3. properties field of ProvisionWatcher The proper way to show map[string]any in swagger is like following: tags: tag1: field1: "field1Value" field2: "field2Value" tag2: field3: "field3Value" field4: "field4Value" field5: "field5Value" However, #4375 accidentally add extra hyphens like following: tags: - tag1: field1: "field1Value" field2: "field2Value" - tag2: field3: "field3Value" field4: "field4Value" field5: "field5Value" Those hyphens should be removed for proper map[string] representation. Signed-off-by: Jude Hung --- openapi/v3/core-metadata.yaml | 96 +++++++++++++++++------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/openapi/v3/core-metadata.yaml b/openapi/v3/core-metadata.yaml index 11b43f1d39..59d97d2e01 100644 --- a/openapi/v3/core-metadata.yaml +++ b/openapi/v3/core-metadata.yaml @@ -1187,20 +1187,20 @@ components: Port: "502" UnitID: "1" tags: - - tag1: - field1: "field1Value" - field2: "field2Value" - - tag2: - field3: "field3Value" - field4: "field4Value" - field5: "field5Value" + tag1: + field1: "field1Value" + field2: "field2Value" + tag2: + field3: "field3Value" + field4: "field4Value" + field5: "field5Value" properties: - - DeviceInstance: - instanceName: "myInstance" - instanceId: "instance1" - - Firmware: - firmwareId: "firmwareABC" - firmwareVersion: "v1.1.2" + DeviceInstance: + instanceName: "myInstance" + instanceId: "instance1" + Firmware: + firmwareId: "firmwareABC" + firmwareVersion: "v1.1.2" UpdateDeviceRequest: value: - apiVersion: v3 @@ -1302,9 +1302,9 @@ components: serviceName: "device-simple" adminState: "UNLOCKED" properties: - - DeviceNameTemplate: - valueReplace: true - template: "device-name-{{Address}}-{{Port}" + DeviceNameTemplate: + valueReplace: true + template: "device-name-{{Address}}-{{Port}" GetAllDevicesResponse: value: apiVersion: "v3" @@ -1333,20 +1333,20 @@ components: Address: "device-virtual-bool-01" Port: "300" tags: - - tag1: - field1: "field1Value" - field2: "field2Value" - - tag2: - field3: "field3Value" - field4: "field4Value" - field5: "field5Value" + tag1: + field1: "field1Value" + field2: "field2Value" + tag2: + field3: "field3Value" + field4: "field4Value" + field5: "field5Value" properties: - - DeviceInstance: - instanceName: "myInstance" - instanceId: "instance1" - - Firmware: - firmwareId: "firmwareABC" - firmwareVersion: "v1.1.2" + DeviceInstance: + instanceName: "myInstance" + instanceId: "instance1" + Firmware: + firmwareId: "firmwareABC" + firmwareVersion: "v1.1.2" - id: "03bd5ce0-b967-4165-a335-775fea604142" name: "Random-UnsignedInteger-Device" description: "Example of Device Virtual" @@ -1371,20 +1371,20 @@ components: Address: "device-virtual-uint-01" Port: "300" tags: - - tag1: - field1: "field1Value" - field2: "field2Value" - - tag2: - field3: "field3Value" - field4: "field4Value" - field5: "field5Value" + tag1: + field1: "field1Value" + field2: "field2Value" + tag2: + field3: "field3Value" + field4: "field4Value" + field5: "field5Value" properties: - - DeviceInstance: - instanceName: "myInstance" - instanceId: "instance2" - - Firmware: - firmwareId: "firmwareXYZ" - firmwareVersion: "v3.1.0" + DeviceInstance: + instanceName: "myInstance" + instanceId: "instance2" + Firmware: + firmwareId: "firmwareXYZ" + firmwareVersion: "v3.1.0" GetAllDeviceProfilesResponse: value: apiVersion: "v3" @@ -1465,9 +1465,9 @@ components: interval: "10s" onChange: false properties: - - DeviceNameTemplate: - valueReplace: true - template: "device-name-{{Address}}-{{Port}" + DeviceNameTemplate: + valueReplace: true + template: "device-name-{{Address}}-{{Port}" - id: "90c971f0-cb84-4bda-a9f0-d9494196b54d" name: "simple-watcher" created: 0 @@ -3605,9 +3605,9 @@ paths: interval: "10s" onChange: false properties: - - DeviceNameTemplate: - valueReplace: true - template: "device-name-{{Address}}-{{Port}" + DeviceNameTemplate: + valueReplace: true + template: "device-name-{{Address}}-{{Port}" '400': description: "Request is in an invalid state" headers: