From d77b5966b49a93b2c5f47f09f98921bbe3e85d3d Mon Sep 17 00:00:00 2001 From: Joo-Chul Kevin Lee Date: Fri, 12 Jul 2019 11:36:43 +0900 Subject: [PATCH 1/6] [Bugzilla-2986] new file: KeyCardSwitchResURI.swagger.json - add new Resource type "oic.r.keycardswitch" --- KeyCardSwitchResURI.swagger.json | 96 ++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 KeyCardSwitchResURI.swagger.json diff --git a/KeyCardSwitchResURI.swagger.json b/KeyCardSwitchResURI.swagger.json new file mode 100644 index 0000000..b0209c4 --- /dev/null +++ b/KeyCardSwitchResURI.swagger.json @@ -0,0 +1,96 @@ +{ + "swagger": "2.0", + "info": { + "title": "KeyCard Switch", + "version": "2019XXXX", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "Copyright 2018-2019 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/KeyCardSwitchResURI" : { + "get": { + "description": "This Resource describes the operation of a KeyCard style switch.\nThe Property \"stateofcard\" is a string enum type.\nA value of 'cardInserted' means that the the keycard has just been inserted.\nA value of 'cardRemoved' means that the keycard has just been removed.", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": + { + "rt": ["oic.r.keycardswitch"], + "if": ["oic.if.s", "oic.if.baseline"], + "value": true + } + , + "schema": { "$ref": "#/definitions/KeyCardSwitch" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.s", "oic.if.baseline"] + } + }, + "definitions": { + "KeyCardSwitch" : { + "properties": { + "rt": { + "description": "The Resource Type", + "items": { + "enum": ["oic.r.keycardswitch"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "stateofcard": { + "description": "The status of the keycardswitch", + "readOnly": true, + "type": "string", + "enum": [ + "cardInserted", + "cardRemoved" + ] + }, + "n": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" + }, + "id": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" + }, + "if": { + "description": "The OCF Interface set supported by this Resource.", + "items": { + "enum": [ + "oic.if.s", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["stateofcard"] + } + } +} From b8ecb415daeef7f072ad3c27b137d42c70ce379c Mon Sep 17 00:00:00 2001 From: Joo-Chul Lee Date: Fri, 12 Jul 2019 21:10:24 +0900 Subject: [PATCH 2/6] [Bugzilla-2986] modified: KeyCardSwitchResURI.swagger.json - fix erro in response example --- KeyCardSwitchResURI.swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KeyCardSwitchResURI.swagger.json b/KeyCardSwitchResURI.swagger.json index b0209c4..699ed47 100644 --- a/KeyCardSwitchResURI.swagger.json +++ b/KeyCardSwitchResURI.swagger.json @@ -27,7 +27,7 @@ { "rt": ["oic.r.keycardswitch"], "if": ["oic.if.s", "oic.if.baseline"], - "value": true + "stateofcard": "cardInserted" } , "schema": { "$ref": "#/definitions/KeyCardSwitch" } From cc0b9d782beda5bf59b72063361546367f489739 Mon Sep 17 00:00:00 2001 From: Joo-Chul Lee Date: Fri, 19 Jul 2019 01:12:35 +0900 Subject: [PATCH 3/6] [Bugzilla=2986] modified: KeyCardSwitchResURI.swagger.json - rename enum value --- KeyCardSwitchResURI.swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KeyCardSwitchResURI.swagger.json b/KeyCardSwitchResURI.swagger.json index 699ed47..e2b3df4 100644 --- a/KeyCardSwitchResURI.swagger.json +++ b/KeyCardSwitchResURI.swagger.json @@ -65,7 +65,7 @@ "type": "string", "enum": [ "cardInserted", - "cardRemoved" + "cardNotInserted" ] }, "n": { From c242015bc5d3de6bfc804d3f28f0b4642bc5eecf Mon Sep 17 00:00:00 2001 From: Joo-Chul Lee Date: Mon, 29 Jul 2019 17:30:29 +0900 Subject: [PATCH 4/6] [KeyCardSwitchResURI.swagger.json] modified: KeyCardSwitchResURI.swagger.json - description for "stateofcard" is updated (add more explanation for each enum value) --- KeyCardSwitchResURI.swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KeyCardSwitchResURI.swagger.json b/KeyCardSwitchResURI.swagger.json index e2b3df4..6746811 100644 --- a/KeyCardSwitchResURI.swagger.json +++ b/KeyCardSwitchResURI.swagger.json @@ -60,7 +60,7 @@ "type": "array" }, "stateofcard": { - "description": "The status of the keycardswitch", + "description": "The status of the keycardswitch\ncardInserted means that a Card is inserted and the card passed validation check,\ncardNotInserted means that a Card is not inserted, or a card is inserted but card failed to pass validation check", "readOnly": true, "type": "string", "enum": [ From f0ca65bf2b0c51004073ead98900ac1900e52f9f Mon Sep 17 00:00:00 2001 From: Joo-Chul Kevin Lee Date: Mon, 29 Jul 2019 17:57:04 +0900 Subject: [PATCH 5/6] [KeyCardSwitchResURI.swagger.json] modified: KeyCardSwitchResURI.swagger.json - add "." to the end of first sentence of description for "stateofcard" --- KeyCardSwitchResURI.swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KeyCardSwitchResURI.swagger.json b/KeyCardSwitchResURI.swagger.json index 6746811..9b4bd71 100644 --- a/KeyCardSwitchResURI.swagger.json +++ b/KeyCardSwitchResURI.swagger.json @@ -60,7 +60,7 @@ "type": "array" }, "stateofcard": { - "description": "The status of the keycardswitch\ncardInserted means that a Card is inserted and the card passed validation check,\ncardNotInserted means that a Card is not inserted, or a card is inserted but card failed to pass validation check", + "description": "The status of the keycardswitch.\ncardInserted means that a Card is inserted and the card passed validation check,\ncardNotInserted means that a Card is not inserted, or a card is inserted but card failed to pass validation check", "readOnly": true, "type": "string", "enum": [ From 602b87c4a598add5bd5ca6aba1d4fdb892eb3180 Mon Sep 17 00:00:00 2001 From: Joo-Chul Lee Date: Thu, 8 Aug 2019 14:37:43 +0900 Subject: [PATCH 6/6] modified: KeyCardSwitchResURI.swagger.json - fix version, description, enum values of "stateofcard" --- KeyCardSwitchResURI.swagger.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/KeyCardSwitchResURI.swagger.json b/KeyCardSwitchResURI.swagger.json index 9b4bd71..ab32be3 100644 --- a/KeyCardSwitchResURI.swagger.json +++ b/KeyCardSwitchResURI.swagger.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "KeyCard Switch", - "version": "2019XXXX", + "version": "20190807", "license": { "name": "OCF Data Model License", "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", @@ -16,7 +16,7 @@ "paths": { "/KeyCardSwitchResURI" : { "get": { - "description": "This Resource describes the operation of a KeyCard style switch.\nThe Property \"stateofcard\" is a string enum type.\nA value of 'cardInserted' means that the the keycard has just been inserted.\nA value of 'cardRemoved' means that the keycard has just been removed.", + "description": "This Resource describes the operation of a KeyCard style switch. It has one mandatory Property,\"stateofcard\", which is a string enum type. It has two enum values: \"validCardInserted\", \"validCardNotInserted\". \"validCardInserted\" means that a keycard was inserted and passed validation check. \"validCardNotInserted\" means that a keycard is not inserted or it was inserted but failed to pass validation check.", "parameters": [ {"$ref": "#/parameters/interface"} ], @@ -27,7 +27,7 @@ { "rt": ["oic.r.keycardswitch"], "if": ["oic.if.s", "oic.if.baseline"], - "stateofcard": "cardInserted" + "stateofcard": "validCardInserted" } , "schema": { "$ref": "#/definitions/KeyCardSwitch" } @@ -48,7 +48,7 @@ "KeyCardSwitch" : { "properties": { "rt": { - "description": "The Resource Type", + "description": "The Resource Type of KeyCardSwitch", "items": { "enum": ["oic.r.keycardswitch"], "maxLength": 64, @@ -60,12 +60,12 @@ "type": "array" }, "stateofcard": { - "description": "The status of the keycardswitch.\ncardInserted means that a Card is inserted and the card passed validation check,\ncardNotInserted means that a Card is not inserted, or a card is inserted but card failed to pass validation check", + "description": "The status of the keycardswitch. \"validCardInserted\" means that a keycard was inserted and passed validation check. \"validCardNotInserted\" means that a keycard is not inserted or it was inserted but failed to pass validation check.", "readOnly": true, "type": "string", "enum": [ - "cardInserted", - "cardNotInserted" + "validCardInserted", + "validCardNotInserted" ] }, "n": {