├── .github └── workflows │ └── validate.yml ├── DISCLAIMER.md ├── LICENSE-3C.md ├── LICENSE.md ├── README.md ├── examples ├── introspectiondevicedataexample-collections.swagger.json └── introspectiondevicedataexample.swagger.json ├── schemas ├── DISCLAIMER.md ├── LICENSE.md ├── oic.common.properties.core-schema.json ├── oic.links.properties.core-schema.json └── oic.types-schema.json ├── swagger2.0 ├── oic.r.mqtt.conf.swagger.json ├── oic.wk.atomicmeasurement.swagger.json ├── oic.wk.col.swagger.json ├── oic.wk.d.swagger.json ├── oic.wk.introspection.swagger.json ├── oic.wk.p.swagger.json └── oic.wk.res.swagger.json └── tools └── gen_sections_jakartaplus_core.bat /.github/workflows/validate.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI-validate 4 | 5 | # Controls when the action will run. Triggers the workflow on push or pull request 6 | # events but only for the master branch 7 | 8 | #outputs: 9 | # random-number: 10 | # description: "Random number" 11 | # value: ${{ steps.random-number-generator.outputs.random-id }} 12 | #runs: 13 | # using: "composite" 14 | # steps: 15 | # - id: random-number-generator 16 | # run: echo "::set-output name=random-id::$(echo $RANDOM)" 17 | # shell: bash 18 | 19 | on: 20 | push: 21 | branches: [ master ] 22 | pull_request: 23 | branches: [ master ] 24 | 25 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 26 | jobs: 27 | # This workflow contains a single job called "build" 28 | build: 29 | # The type of runner that the job will run on 30 | runs-on: ubuntu-latest 31 | 32 | # Steps represent a sequence of tasks that will be executed as part of the job 33 | steps: 34 | - name: Get Repo 35 | id: getrepo 36 | uses: actions/checkout@v2 37 | - name: Get OpenAPI files 38 | id: getfiles 39 | run: | 40 | # Using github env (newline separated file list) 41 | # find . -type f \( -iname ".*" ! -iname ".htaccess" \) 42 | # Refrige Refrigera 43 | echo 'FILE_LIST<> $GITHUB_ENV 44 | find . -type f -iname "*.swagger.json" ! -name '*wk.col*' ! -name '*wk.res*' ! -name '*atomicmeasurement*' ! -name '*introspectiondevicedataexample-collections*' >> $GITHUB_ENV 45 | echo 'EOF' >> $GITHUB_ENV 46 | ## files not checked: 47 | find . -type f -name '*wk.col*' 48 | find . -type f -name '*wk.res*' 49 | find . -type f -name '*atomicmeasurement*' 50 | find . -type f -name '*introspectiondevicedataexample-collections*' 51 | # Using step output (space separated file list) 52 | FILES="$(find . -type f -iname "*.json")" 53 | echo "::set-output name=file_list::$FILES" 54 | 55 | - name: swagger-validator 56 | #uses: mbowman100/swagger-validator-action@master 57 | uses: mbowman100/swagger-validator-action@2.0 58 | #'if: env.FILE_COUNT != '0' # Comment out if you want it to fail if no files found 59 | with: 60 | files: ${{ env.FILE_LIST }} 61 | #files: ${{ steps.getfiles.outputs.file_list }} # For if you're using output -------------------------------------------------------------------------------- /DISCLAIMER.md: -------------------------------------------------------------------------------- 1 | "THIS SOFTWARE IS PROVIDED BY THE OPEN CONNECTIVITY FOUNDATION, INC. 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR WARRANTIES OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE OPEN CONNECTIVITY FOUNDATION, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 2 | -------------------------------------------------------------------------------- /LICENSE-3C.md: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 3 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 4 | 2. Redistributions in binary form must reproduce the above copyright notice, 5 | this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 6 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software 7 | without specific prior written permission. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 10 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 11 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 12 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 13 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 14 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 15 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 3 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # core 2 | 3 | This repo contains the data models that are part of the OCF core specification. The latest version of which can be found at: 4 | 5 | https://openconnectivity.org/specs/OCF_Core_Specification.pdf 6 | 7 | ## referencing files with full URL 8 | 9 | This repo uses the GitHub pages feature. e.g. all files can be accessed by using the URL: 10 | 11 | http://openconnectivityfoundation.github.io/core/ 12 | 13 | and then use the path and filename to retrieve the file by means of http(s). For example, the URL of the swagger file with rt type = oic.wk.p is: 14 | 15 | http://openconnectivityfoundation.github.io/core/swagger2.0/oic.wk.p.swagger.json 16 | 17 | The full url can be used to reference a property definition. For example to reference in a schema the definition of UUID defined in the schema file: oic.types-schema.json use: 18 | 19 | "$ref": "http://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#definitions/uuid" 20 | 21 | ## Introspection 22 | ### Examples 23 | 24 | [The examples folder](https://github.com/openconnectivityfoundation/core/tree/master/examples) contains two examples showing how Introspection Device Data (IDD) may be constructed for a Device. 25 | 26 | [introspectiondevicedataexample.swagger.json](https://github.com/openconnectivityfoundation/core/tree/master/examples/introspectiondevicedataexample.swagger.json) illustrates a simple device that exposes an instance of a Binary Switch Resource and an instance of a Brightness Resource 27 | 28 | [introspectiondevicedataexample-collections.swagger.json](https://github.com/openconnectivityfoundation/core/tree/master/examples/introspectiondevicedataexample-collections.swagger.json) illustrates a case where the Device supports the ability to create instances of Binary Switch and instances of Humidity via a Collection that exposes the *oic.if.create* OCF Interface. 29 | 30 | ### Applying the IDD to a created Resource 31 | 32 | In the Collections case a Client can determine how to apply the IDD definition for created Resources via the following procedure: 33 | 34 | - Client creates a Resource using POST with *oic.if.create* 35 | - The newly created Resource is added as a Link in the Collection 36 | - The URL for the newly created Resource is provided to the Client in the success path response 37 | - The Client can then retrieve the Resource using the provided URL using the *oic.if.baseline* OCF Interface 38 | - The Resource Representation returned provides the Client with the Resource Type of the created Resource (referenced below as **{created RT}**) 39 | - The Client knows how to deal with the created Resource from the "/Collection Root/**{created RT}**" URL in the IDD 40 | 41 | -------------------------------------------------------------------------------- /examples/introspectiondevicedataexample-collections.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "IDD example for a collection that supports create (oic.if.create)", 5 | "version": "2020-05-05", 6 | "license": { 7 | "name": "OCF Data Model License", 8 | "url": "https://openconnectivityfoundation.github.io/core/LICENSE.md", 9 | "x-copyright": "Copyright 2020 Open Connectivity Foundation, Inc. All rights reserved." 10 | }, 11 | "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" 12 | }, 13 | "schemes": [ 14 | "http" 15 | ], 16 | "consumes": [ 17 | "application/json" 18 | ], 19 | "produces": [ 20 | "application/json" 21 | ], 22 | "paths": { 23 | "/collection?if=oic.if.ll": { 24 | "get": { 25 | "description": "", 26 | "parameters": [ 27 | {"$ref": "#/parameters/interface-all"} 28 | ], 29 | "responses": { 30 | "200": { 31 | "description" : "", 32 | "schema": { 33 | "$ref": "#/definitions/slinks" 34 | } 35 | } 36 | } 37 | } 38 | }, 39 | "/collection?if=oic.if.baseline": { 40 | "get": { 41 | "description": "", 42 | "parameters": [ 43 | {"$ref": "#/parameters/interface-all"} 44 | ], 45 | "responses": { 46 | "200": { 47 | "description" : "", 48 | "schema": { "$ref": "#/definitions/collection" } 49 | } 50 | } 51 | } 52 | }, 53 | "/collection?if=oic.if.create": { 54 | "get": { 55 | "description": "Retrieval response using oic.if.create", 56 | "parameters": [ 57 | {"$ref": "#/parameters/interface-create"} 58 | ], 59 | "responses": { 60 | "200": { 61 | "description" : "Retrival on oic.if.create provides an empty payload." 62 | } 63 | } 64 | }, 65 | "post": { 66 | "description": "", 67 | "parameters": [ 68 | {"$ref": "#/parameters/interface-create"}, 69 | { 70 | "name": "body", 71 | "in": "body", 72 | "required": true, 73 | "schema": { "$ref": "#/definitions/collection-create" }, 74 | } 75 | ], 76 | "responses": { 77 | "200": { 78 | "description" : "", 79 | "schema": { "$ref": "#/definitions/collection-create" } 80 | } 81 | } 82 | } 83 | }, 84 | "/collection/{oic.r.switch.binary}" : { 85 | "get": { 86 | "description": "", 87 | "parameters": [ 88 | {"$ref": "#/parameters/interface-baseline"}, 89 | {"$ref": "#/parameters/oic.r.switch.binary"} 90 | ], 91 | "responses": { 92 | "200": { 93 | "description" : "", 94 | "schema": { 95 | "$ref": "#/definitions/createdresource-binaryswitch" 96 | } 97 | } 98 | } 99 | } 100 | }, 101 | "/collection/{oic.r.humidity}" : { 102 | "get": { 103 | "description": "", 104 | "parameters": [ 105 | {"$ref": "#/parameters/interface-baseline"}, 106 | {"$ref": "#/parameters/oic.r.humidity"} 107 | ], 108 | "responses": { 109 | "200": { 110 | "description" : "", 111 | "schema": { 112 | "$ref": "#/definitions/createdresource-humidity" 113 | } 114 | } 115 | } 116 | } 117 | }, 118 | "/collection/{oic.r.humidity}?if=oic.if.delete": { 119 | "get": { 120 | "description": "Retrieval response using oic.if.delete", 121 | "parameters": [ 122 | {"$ref": "#/parameters/interface-delete"}, 123 | {"$ref": "#/parameters/oic.r.humidity"} 124 | ], 125 | "responses": { 126 | "200": { 127 | "description" : "Retrieval on oic.if.create provides an empty payload.", 128 | } 129 | } 130 | }, 131 | "delete": { 132 | "description": "", 133 | "parameters": [ 134 | {"$ref": "#/parameters/interface-delete"}, 135 | {"$ref": "#/parameters/oic.r.humidity"} 136 | ], 137 | "responses": { 138 | "200": { 139 | "description" : "", 140 | "schema": { "$ref": "#/definitions/resource-delete" } 141 | } 142 | } 143 | } 144 | }, 145 | "/collection/{oic.r.switch.binary}?if=oic.if.delete":{ 146 | "get": { 147 | "description": "Retrieval response using oic.if.delete", 148 | "parameters": [ 149 | {"$ref": "#/parameters/interface-delete"}, 150 | {"$ref": "#/parameters/oic.r.switch.binary"} 151 | ], 152 | "responses": { 153 | "200":{ 154 | "description" :"Retrieval on oic.if.create provides an empty payload." 155 | } 156 | } 157 | }, 158 | "delete":{ 159 | "description": "", 160 | "parameters": [ 161 | {"$ref": "#/parameters/interface-delete"}, 162 | {"$ref": "#/parameters/oic.r.switch.binary"} 163 | ], 164 | "responses": { 165 | "200": { 166 | "description": "", 167 | "schema": { "$ref":"#/definitions/resource-delete" } 168 | } 169 | } 170 | } 171 | } 172 | }, 173 | "parameters": { 174 | "interface-all" : { 175 | "in" : "query", 176 | "name" : "if", 177 | "type" : "string", 178 | "enum" : ["oic.if.ll","oic.if.baseline","oic.if.create"] 179 | }, 180 | "interface-baseline" : { 181 | "in" : "query", 182 | "name" : "if", 183 | "type" : "string", 184 | "enum" : ["oic.if.baseline"] 185 | }, 186 | "interface-create" : { 187 | "in" : "query", 188 | "name" : "if", 189 | "type" : "string", 190 | "enum" : ["oic.if.create"] 191 | }, 192 | "interface-delete" : { 193 | "in" : "query", 194 | "name" : "if", 195 | "type" : "string", 196 | "enum" : ["oic.if.delete"] 197 | }, 198 | "oic.r.switch.binary": { 199 | "description": "URI fragment of the created resource", 200 | "name": "oic.r.switch.binary", 201 | "in": "path", 202 | "type": "string", 203 | "required": true 204 | }, 205 | "oic.r.humidity": { 206 | "description": "URI fragment of the created resource", 207 | "name": "oic.r.humidity", 208 | "in": "path", 209 | "type": "string", 210 | "required": true 211 | } 212 | }, 213 | "definitions": { 214 | "collection": { 215 | "properties": { 216 | "links": { 217 | "description": "A set of simple or individual OCF Links.", 218 | "items": { 219 | "$ref": "#/definitions/oic.oic-link-base" 220 | }, 221 | "type": "array" 222 | }, 223 | "n": { 224 | "$ref" : "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 225 | }, 226 | "id": { 227 | "$ref" : "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 228 | }, 229 | "if": { 230 | "type": "array", 231 | "description": "The OCF Interfaces supported by this Resource", 232 | "items": { 233 | "enum": [ 234 | "oic.if.ll", 235 | "oic.if.baseline", 236 | "oic.if.create" 237 | ], 238 | "type": "string", 239 | "maxLength": 64 240 | }, 241 | "minItems": 3, 242 | "uniqueItems": true, 243 | "readOnly": true 244 | }, 245 | "rts": { 246 | "description": "The list of allowable Resource Types in Links included in the Collection", 247 | "items": { 248 | "enum": ["oic.r.switch.binary","oic.r.humidity"], 249 | "type": "string", 250 | "maxLength": 64 251 | }, 252 | "minItems": 1, 253 | "uniqueItems": true, 254 | "readOnly": true, 255 | "type": "array" 256 | }, 257 | "rt": { 258 | "description": "Resource Type of the Resource", 259 | "items": { 260 | "enum": ["oic.wk.collection"], 261 | "type": "string", 262 | "maxLength": 64 263 | }, 264 | "minItems": 1, 265 | "readOnly": true, 266 | "uniqueItems": true, 267 | "type": "array" 268 | } 269 | }, 270 | "type": "object", 271 | "required": [ 272 | "rt", 273 | "if", 274 | "links" 275 | ] 276 | }, 277 | "collection-create": { 278 | "type": "object", 279 | "properties": { 280 | "href": { 281 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 282 | }, 283 | "if": { 284 | "description": "The OCF Interfaces supported by the created Resource", 285 | "items": { 286 | "enum": [ 287 | "oic.if.s", 288 | "oic.if.baseline", 289 | "oic.if.delete" 290 | ], 291 | "type": "string", 292 | "maxLength": 64 293 | }, 294 | "minItems": 1, 295 | "uniqueItems": true, 296 | "type": "array" 297 | }, 298 | "ins": { 299 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/ins" 300 | }, 301 | "p": { 302 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/p" 303 | }, 304 | "rt": { 305 | "description": "Resource Type of the created Resource", 306 | "items": { 307 | "maxLength": 64, 308 | "type": "string", 309 | "enum": ["oic.r.switch.binary","oic.r.humidity"] 310 | }, 311 | "minItems": 1, 312 | "uniqueItems": true, 313 | "type": "array" 314 | }, 315 | "rep":{ 316 | "oneOf":[ 317 | {"$ref": "#/definitions/createdresource-humidity"}, 318 | {"$ref": "#/definitions/createdresource-binaryswitch"} 319 | ] 320 | } 321 | } 322 | }, 323 | "createdresource-binaryswitch": { 324 | "properties": { 325 | "rt": { 326 | "description": "Resource Type of the Resource", 327 | "items": { 328 | "enum": ["oic.r.switch.binary"], 329 | "type": "string", 330 | "maxLength": 64 331 | }, 332 | "minItems": 1, 333 | "readOnly": true, 334 | "uniqueItems": true, 335 | "type": "array" 336 | }, 337 | "value": { 338 | "description": "The status of the switch.", 339 | "type": "boolean" 340 | }, 341 | "n": { 342 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 343 | }, 344 | "id": { 345 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 346 | }, 347 | "if": { 348 | "description": "The OCF Interface set supported by this Resource.", 349 | "items": { 350 | "enum": [ 351 | "oic.if.a", 352 | "oic.if.baseline" 353 | ], 354 | "type": "string" 355 | }, 356 | "minItems": 2, 357 | "uniqueItems": true, 358 | "readOnly": true, 359 | "type": "array" 360 | } 361 | }, 362 | "type": "object", 363 | "required": ["value"] 364 | }, 365 | "createdresource-humidity": { 366 | "properties": { 367 | "rt": { 368 | "description": "The Resource Type.", 369 | "items": { 370 | "enum": ["oic.r.humidity"], 371 | "maxLength": 64, 372 | "type": "string" 373 | }, 374 | "minItems": 1, 375 | "uniqueItems": true, 376 | "readOnly": true, 377 | "type": "array" 378 | }, 379 | "desiredHumidity": { 380 | "description": "The desired value for humidity.", 381 | "maximum": 100, 382 | "minimum": 0, 383 | "type": "integer" 384 | }, 385 | "humidity": { 386 | "description": "The current sensed value for humidity.", 387 | "maximum": 100, 388 | "minimum": 0, 389 | "readOnly": true, 390 | "type": "integer" 391 | }, 392 | "n": { 393 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 394 | }, 395 | "id": { 396 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 397 | }, 398 | "if": { 399 | "description": "The OCF Interface set supported by this Resource.", 400 | "items": { 401 | "enum": [ 402 | "oic.if.s", 403 | "oic.if.baseline" 404 | ], 405 | "type": "string" 406 | }, 407 | "minItems": 2, 408 | "uniqueItems": true, 409 | "readOnly": true, 410 | "type": "array" 411 | } 412 | }, 413 | "type": "object", 414 | "required": ["humidity"] 415 | }, 416 | "slinks" : { 417 | "type" : "array", 418 | "items" : { 419 | "$ref": "#/definitions/oic.oic-link-base" 420 | } 421 | }, 422 | "oic.oic-link-base": { 423 | "properties": { 424 | "anchor": { 425 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/anchor" 426 | }, 427 | "di": { 428 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/di" 429 | }, 430 | "eps": { 431 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/eps" 432 | }, 433 | "href": { 434 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 435 | }, 436 | "ins": { 437 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/ins" 438 | }, 439 | "p": { 440 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/p" 441 | }, 442 | "rel": { 443 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_array" 444 | }, 445 | "title": { 446 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/title" 447 | }, 448 | "type": { 449 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/type" 450 | }, 451 | "if": { 452 | "description": "The OCF Interfaces supported by the Linked Resource", 453 | "items": { 454 | "enum": [ 455 | "oic.if.baseline", 456 | "oic.if.delete", 457 | "oic.if.s" 458 | ], 459 | "type": "string", 460 | "maxLength": 64 461 | }, 462 | "minItems": 1, 463 | "uniqueItems": true, 464 | "readOnly": true, 465 | "type": "array" 466 | }, 467 | "rt": { 468 | "description": "The Resource Type of the Linked Resource", 469 | "items": { 470 | "enum": ["oic.r.switch.binary","oic.r.humidity"], 471 | "type": "string", 472 | "maxLength": 64 473 | }, 474 | "minItems": 1, 475 | "uniqueItems": true, 476 | "readOnly": true, 477 | "type": "array" 478 | } 479 | }, 480 | "required": ["href","rt","if"], 481 | "type": "object" 482 | }, 483 | "resource-delete": { 484 | "type": "object", 485 | "properties": { 486 | "href": { 487 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 488 | } 489 | }, 490 | "required": ["href"] 491 | } 492 | } 493 | } 494 | -------------------------------------------------------------------------------- /examples/introspectiondevicedataexample.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "my_example_device", 5 | "version": "my device version" 6 | }, 7 | "schemes": [ 8 | "http" 9 | ], 10 | "consumes": [ 11 | "application/json" 12 | ], 13 | "produces": [ 14 | "application/json" 15 | ], 16 | "paths": { 17 | "/switch": { 18 | "get": { 19 | "parameters": [ 20 | { 21 | "name": "if", 22 | "in": "query", 23 | "description": "", 24 | "enum": [ 25 | "oic.if.a", 26 | "oic.if.baseline" 27 | ], 28 | "type": "string" 29 | } 30 | ], 31 | "responses": { 32 | "200": { 33 | "description": "", 34 | "schema": { 35 | "$ref": "#/definitions/BinarySwitch" 36 | } 37 | } 38 | } 39 | }, 40 | "post": { 41 | "parameters": [ 42 | { 43 | "name": "if", 44 | "in": "query", 45 | "description": "", 46 | "enum": [ 47 | "oic.if.a", 48 | "oic.if.baseline" 49 | ], 50 | "type": "string" 51 | }, 52 | { 53 | "name": "body", 54 | "in": "body", 55 | "required": false, 56 | "schema": { 57 | "$ref": "#/definitions/BinarySwitch" 58 | } 59 | } 60 | ], 61 | "responses": { 62 | "200": { 63 | "description": "", 64 | "schema": { 65 | "$ref": "#/definitions/BinarySwitch" 66 | } 67 | } 68 | } 69 | } 70 | }, 71 | "/brightness": { 72 | "get": { 73 | "parameters": [ 74 | { 75 | "name": "if", 76 | "in": "query", 77 | "description": "", 78 | "enum": [ 79 | "oic.if.a", 80 | "oic.if.baseline" 81 | ], 82 | "type": "string" 83 | } 84 | ], 85 | "responses": { 86 | "200": { 87 | "description": "", 88 | "schema": { 89 | "$ref": "#/definitions/Brightness" 90 | } 91 | } 92 | } 93 | }, 94 | "post": { 95 | "parameters": [ 96 | { 97 | "name": "if", 98 | "in": "query", 99 | "description": "", 100 | "enum": [ 101 | "oic.if.a", 102 | "oic.if.baseline" 103 | ], 104 | "type": "string" 105 | }, 106 | { 107 | "name": "body", 108 | "in": "body", 109 | "required": false, 110 | "schema": { 111 | "$ref": "#/definitions/Brightness" 112 | } 113 | } 114 | ], 115 | "responses": { 116 | "200": { 117 | "description": "", 118 | "schema": { 119 | "$ref": "#/definitions/Brightness" 120 | } 121 | } 122 | } 123 | } 124 | } 125 | }, 126 | "definitions": { 127 | "BinarySwitch": { 128 | "type": "object", 129 | "required": [ 130 | "id" 131 | ], 132 | "properties": { 133 | "value": { 134 | "type": "boolean", 135 | "description": "Status of the switch" 136 | }, 137 | "rt": { 138 | "type": "array", 139 | "items": [ 140 | { 141 | "type": "string", 142 | "maxLength": 64 143 | } 144 | ], 145 | "minItems": 1, 146 | "description": "Resource Type", 147 | "readOnly": true, 148 | "default": [ 149 | "oic.r.switch.binary" 150 | ] 151 | }, 152 | "if": { 153 | "type": "array", 154 | "description": "The interface set supported by this resource", 155 | "readOnly": true, 156 | "items": { 157 | "type": "string", 158 | "enum": [ 159 | "oic.if.baseline", 160 | "oic.if.a" 161 | ] 162 | } 163 | }, 164 | "p": { 165 | "type": "integer", 166 | "description": "Bitmap indicating observable and discoverable", 167 | "readOnly": true 168 | }, 169 | "n": { 170 | "type": "string", 171 | "description": "Friendly name of the resource", 172 | "readOnly": true 173 | }, 174 | "id": { 175 | "type": "string", 176 | "description": "Instance ID of this specific resource", 177 | "readOnly": true 178 | }, 179 | "range": { 180 | "type": "array", 181 | "description": "The valid range for the value Property", 182 | "readOnly": true, 183 | "minItems": 2, 184 | "maxItems": 2, 185 | "items": { 186 | "type": "number" 187 | } 188 | } 189 | } 190 | }, 191 | "Brightness": { 192 | "type": "object", 193 | "required": [ 194 | "id" 195 | ], 196 | "properties": { 197 | "brighness": { 198 | "type": "integer", 199 | "description": "Current sensed or set value for Brightness" 200 | }, 201 | "rt": { 202 | "type": "array", 203 | "items": [ 204 | { 205 | "type": "string", 206 | "maxLength": 64 207 | } 208 | ], 209 | "minItems": 1, 210 | "description": "Resource Type", 211 | "readOnly": true, 212 | "default": [ 213 | "oic.r.light.brightness" 214 | ] 215 | }, 216 | "if": { 217 | "type": "array", 218 | "description": "The interface set supported by this resource", 219 | "readOnly": true, 220 | "items": { 221 | "type": "string", 222 | "enum": [ 223 | "oic.if.baseline", 224 | "oic.if.a" 225 | ] 226 | } 227 | }, 228 | "p": { 229 | "type": "integer", 230 | "description": "Bitmap indicating observable and discoverable", 231 | "readOnly": true 232 | }, 233 | "n": { 234 | "type": "string", 235 | "description": "Friendly name of the resource", 236 | "readOnly": true 237 | }, 238 | "id": { 239 | "type": "string", 240 | "description": "Instance ID of this specific resource", 241 | "readOnly": true 242 | }, 243 | "range": { 244 | "type": "array", 245 | "description": "The valid range for the value Property", 246 | "readOnly": true, 247 | "minItems": 2, 248 | "maxItems": 2, 249 | "items": { 250 | "type": "number" 251 | } 252 | } 253 | } 254 | } 255 | } 256 | } -------------------------------------------------------------------------------- /schemas/DISCLAIMER.md: -------------------------------------------------------------------------------- 1 | THIS SOFTWARE IS PROVIDED BY THE OPEN CONNECTIVITY FOUNDATION, INC. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR WARRANTIES OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE OPEN CONNECTIVITY FOUNDATION, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2 | -------------------------------------------------------------------------------- /schemas/LICENSE.md: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 2 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 3 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 4 | -------------------------------------------------------------------------------- /schemas/oic.common.properties.core-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "description" : "Copyright (c) 2018-2019 Open Connectivity Foundation, Inc. All rights reserved.", 5 | "title": "Common resource properties (Core specification)", 6 | "definitions": { 7 | "n": { 8 | "type": "string", 9 | "maxLength": 64, 10 | "readOnly": true, 11 | "description": "Friendly name of the Resource" 12 | }, 13 | "id": { 14 | "type": "string", 15 | "maxLength": 64, 16 | "readOnly": true, 17 | "description": "Instance ID of this specific Resource" 18 | }, 19 | "tag-pos-desc": { 20 | "description": "Descriptive relative position of the Resource", 21 | "allOf": [ 22 | { 23 | "$ref": "oic.types-schema.json#/definitions/pos-descriptions" 24 | }, 25 | { 26 | "readOnly": true 27 | } 28 | ] 29 | }, 30 | "tag-pos-rel": { 31 | "type": "array", 32 | "readOnly": true, 33 | "description": "Relative position; against a known [0,0,0] point.", 34 | "minItems": 3, 35 | "maxItems": 3, 36 | "items": { 37 | "type": "number", 38 | "minimum": -1, 39 | "maximum": 1 40 | } 41 | }, 42 | "tag-func-desc": { 43 | "description": "Descriptive function of the Resource, contains a valid OCF enumeration value", 44 | "type": "string", 45 | "readOnly": true 46 | }, 47 | "tag-locn": { 48 | "allOf": [ 49 | { 50 | "$ref": "oic.types-schema.json#/definitions/locn-descriptions" 51 | }, 52 | { 53 | "description": "Descriptive location of the Resource" 54 | } 55 | ] 56 | }, 57 | "if": { 58 | "description": "The OCF Interfaces that may be supported by any instance of a Resource.", 59 | "items": { 60 | "enum": [ 61 | "oic.if.startup", 62 | "oic.if.startup.revert" 63 | ], 64 | "type": "string" 65 | }, 66 | "minItems": 1, 67 | "readOnly": true, 68 | "uniqueItems": true, 69 | "type": "array" 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /schemas/oic.links.properties.core-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties-schema.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "description" : "Copyright (c) 2018-2019 Open Connectivity Foundation, Inc. All rights reserved.", 5 | "title": "Definition of the properties used to define links.", 6 | "definitions": { 7 | "href": { 8 | "type": "string", 9 | "maxLength": 256, 10 | "description": "This is the target URI, it can be specified as a Relative Reference or fully-qualified URI.", 11 | "format": "uri" 12 | }, 13 | "rel_array": { 14 | "type": "array", 15 | "items": { 16 | "type": "string", 17 | "maxLength": 64 18 | }, 19 | "minItems": 1, 20 | "default": ["hosts"], 21 | "description": "The relation of the target URI referenced by the link to the context URI" 22 | }, 23 | "rel_string": { 24 | "type": "string", 25 | "maxLength": 64, 26 | "default": "hosts", 27 | "description": "The relation of the target URI referenced by the link to the context URI" 28 | }, 29 | "anchor": { 30 | "type": "string", 31 | "maxLength": 256, 32 | "description": "Provides the basis for the rel relationship to the href. May be a URI or a descriptive label." 33 | }, 34 | "di": { 35 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/uuid", 36 | "description": "The device ID." 37 | }, 38 | "p": { 39 | "description": "Specifies the framework policies on the Resource referenced by the target URI", 40 | "type": "object", 41 | "properties": { 42 | "bm": { 43 | "description": "Specifies the framework policies on the Resource referenced by the target URI for e.g. observable and discoverable", 44 | "type": "integer" 45 | } 46 | }, 47 | "required" : ["bm"] 48 | }, 49 | "title": { 50 | "type": "string", 51 | "maxLength": 64, 52 | "description": "A title for the link relation. Can be used by the UI to provide a context." 53 | }, 54 | "ins": { 55 | "type": "integer", 56 | "description": "The instance identifier for this web link in an array of web links - used in Collections" 57 | }, 58 | "type": { 59 | "type": "array", 60 | "description": "A hint at the representation of the Resource referenced by the target URI. This represents the media types that are used for both accepting and emitting.", 61 | "items" : { 62 | "type": "string", 63 | "maxLength": 64 64 | }, 65 | "minItems": 1, 66 | "default": "application/vnd.ocf+cbor" 67 | }, 68 | "eps": { 69 | "type": "array", 70 | "description": "the OCF Endpoint information of the target Resource", 71 | "items": { 72 | "type": "object", 73 | "properties": { 74 | "ep": { 75 | "type": "string", 76 | "format": "uri", 77 | "description": "Transport Protocol Suite + OCF Endpoint Locator" 78 | }, 79 | "pri": { 80 | "type": "integer", 81 | "minimum": 1, 82 | "description": "The priority among multiple OCF Endpoints" 83 | }, 84 | "lat": { 85 | "type": "integer", 86 | "minimum": 0, 87 | "exclusiveMinimum": true, 88 | "description": "The expected latency in seconds, always > 0" 89 | } 90 | } 91 | } 92 | }, 93 | "tag-pos-desc": { 94 | "description": "Descriptive relative position of the Resource", 95 | "allOf": [ 96 | { 97 | "$ref": "oic.types-schema.json#/definitions/pos-descriptions" 98 | }, 99 | { 100 | "readOnly": true 101 | } 102 | ] 103 | }, 104 | "tag-pos-rel": { 105 | "type": "array", 106 | "readOnly": true, 107 | "description": "Relative position; against a known [0,0,0] point.", 108 | "minItems": 3, 109 | "maxItems": 3, 110 | "items": { 111 | "type": "number", 112 | "minimum": -1, 113 | "maximum": 1 114 | } 115 | }, 116 | "tag-func-desc": { 117 | "description": "Descriptive function of the Resource, contains a valid OCF enumeration value", 118 | "type": "string", 119 | "readOnly": true 120 | }, 121 | "tag-locn": { 122 | "allOf": [ 123 | { 124 | "$ref": "oic.types-schema.json#/definitions/locn-descriptions" 125 | }, 126 | { 127 | "description": "Descriptive location of the Resource", 128 | "readOnly": true 129 | } 130 | ] 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /schemas/oic.types-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", 4 | "id": "http://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#", 5 | "definitions" : { 6 | "uuid": { 7 | "description": "Format pattern according to IETF RFC 4122.", 8 | "type": "string", 9 | "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" 10 | }, 11 | "date": { 12 | "description": "The full-date format pattern according to IETF RFC 3339", 13 | "type": "string", 14 | "pattern": "^([0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|2[0-9]|1[0-9]|0[1-9])$" 15 | }, 16 | "duration": { 17 | "description": "A string representing duration formatted as defined in ISO 8601. Allowable formats are: P[n]Y[n]M[n]DT[n]H[n]M[n]S, P[n]W, P[n]Y[n]-M[n]-DT[0-23]H[0-59]:M[0-59]:S, and P[n]W, P[n]Y[n]M[n]DT[0-23]H[0-59]M[0-59]S. P is mandatory, all other elements are optional, time elements must follow a T.", 18 | "type": "string", 19 | "pattern": "^(P(?!$)([0-9]+Y)?([0-9]+M)?([0-9]+W)?([0-9]+D)?((T(?=[0-9]+[HMS])([0-9]+H)?([0-9]+M)?([0-9]+S)?)?))$|^(P[0-9]+W)$|^(P[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|2[0-9]|1[0-9]|0[1-9])T(2[0-3]|1[0-9]|0[1-9]):([0-5][0-9]):([0-5][0-9])$|^(P[0-9]{4})(1[0-2]|0[1-9])(3[0-1]|2[0-9]|1[0-9]|0[1-9])T(2[0-3]|1[0-9]|0[1-9])([0-5][0-9])([0-5][0-9])$" 20 | }, 21 | "language-tag": { 22 | "description": "Format pattern according to IETF RFC 5646 (language tag).", 23 | "type": "string", 24 | "pattern": "^[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*$" 25 | }, 26 | "uint8": { 27 | "description": "A integer that can be represented as a Byte. an array of uint8 can be represented in CBOR as Major type 2", 28 | "type": "integer", 29 | "minimum": 0, 30 | "maximum": 255 31 | }, 32 | "int64": { 33 | "description": "A string instance is valid against this attribute if it contains an integer in the range [-(2**63), (2**63)-1]", 34 | "type": "string", 35 | "pattern": "^0|(-?[1-9][0-9]{0,18})$" 36 | }, 37 | "uint64": { 38 | "description": "A string instance is valid against this attribute if it contains an integer in the range [0, (2**64)-1]", 39 | "type": "string", 40 | "pattern": "^0|([1-9][0-9]{0,19})$" 41 | }, 42 | "pos-descriptions": { 43 | "type": "string", 44 | "enum": ["unknown","top","bottom","left","right","centre","topleft","bottomleft","centreleft","centreright","bottomright","topright","topcentre","bottomcentre"] 45 | }, 46 | "locn-descriptions": { 47 | "type": "string", 48 | "enum": ["unknown","attic","balcony","ballroom","bathroom","bedroom","border","boxroom","cellar","cloakroom", 49 | "conservatory","corridor","deck","den","diningroom","drawingroom","driveway","dungeon","ensuite", 50 | "entrance","familyroom","garage","garden","guestroom","hall","indoor","kitchen","larder","lawn", 51 | "library","livingroom","lounge","mancave","masterbedroom","musicroom","office","outdoor","pantry", 52 | "parkinglot","parlour","patio","receiptionroom","restroom","roof","roofterrace","sauna","scullery", 53 | "shed","sittingroom","snug","spa","studio","suite","swimmingpool","terrace","toilet","utilityroom", 54 | "vegetableplot","ward","yard"] 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /swagger2.0/oic.r.mqtt.conf.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "MQTT configuration", 5 | "version": "2021-02-10", 6 | "license": { 7 | "name": "OCF Data Model License", 8 | "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", 9 | "x-copyright": "Copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." 10 | }, 11 | "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" 12 | }, 13 | "schemes": ["http"], 14 | "consumes": ["application/json"], 15 | "produces": ["application/json"], 16 | "paths": { 17 | "/mqttconfResURI" : { 18 | "get": { 19 | "description": "The Resource through which the MQTT server information can be set.", 20 | "parameters": [ 21 | {"$ref": "#/parameters/interface-all"} 22 | ], 23 | "responses": { 24 | "200": { 25 | "description" : "", 26 | "x-example": { 27 | "rt": ["oic.r.mqtt.conf"], 28 | "server": "", 29 | "port": 8, 30 | "kai" : 60, 31 | "uid" : "", 32 | "pwd" : "", 33 | "cacert" : "", 34 | "clcert" : "", 35 | "log" : "not connected", 36 | "crcode" : -1 37 | }, 38 | "schema": { "$ref": "#/definitions/mqttconf" } 39 | } 40 | } 41 | }, 42 | "post": { 43 | "description": "Set information to connect to an MQTT server\n", 44 | "parameters": [ 45 | {"$ref": "#/parameters/interface-all"}, 46 | { 47 | "name": "body", 48 | "in": "body", 49 | "required": true, 50 | "schema": { "$ref": "#/definitions/mqttconf" }, 51 | "x-example": { 52 | "server": "test.mosquitto.org", 53 | "port": 1883 , 54 | "kai" : 60 55 | } 56 | } 57 | ], 58 | "responses": { 59 | "200": { 60 | "description" : "", 61 | "x-example": { 62 | "rt": ["oic.r.mqtt.conf"], 63 | "server": "test.mosquitto.org", 64 | "port": 8, 65 | "kai" : 60, 66 | "uid" : "", 67 | "pwd" : "", 68 | "cacert" : "", 69 | "clcert" : "", 70 | "log" : "connected", 71 | "crcode" : 0 72 | }, 73 | "schema": { "$ref": "#/definitions/mqttconf" } 74 | } 75 | } 76 | } 77 | } 78 | }, 79 | "parameters": { 80 | "interface-all" : { 81 | "in" : "query", 82 | "name" : "if", 83 | "type" : "string", 84 | "enum" : ["oic.if.rw", "oic.if.baseline"] 85 | } 86 | }, 87 | "definitions": { 88 | "mqttconf" : { 89 | "properties": { 90 | "server" : { 91 | "description": "The connection information of the MQTT server. Can be a URI or IP address", 92 | "type": "string" 93 | }, 94 | "port" : { 95 | "description": "The port to connect too", 96 | "type": "integer" 97 | }, 98 | "kai" : { 99 | "description": "The keep alive interval, in seconds", 100 | "type": "integer" 101 | }, 102 | "uid" : { 103 | "description": "The user id to be supplied when connecting to the MQTT server", 104 | "type": "string" 105 | }, 106 | "pwd" : { 107 | "description": "The password to be supplied when connecting to the MQTT server", 108 | "type": "string" 109 | }, 110 | "cacert" : { 111 | "description": "The certificate authority certificate to be supplied when connecting to the MQTT server", 112 | "type": "string" 113 | }, 114 | "clcert" : { 115 | "description": "The client certificate to be supplied when connecting to the MQTT server", 116 | "type": "string" 117 | }, 118 | "log" : { 119 | "description": "Logging information, giving status information back, formatting not defined", 120 | "type": "string" 121 | }, 122 | "crcode" : { 123 | "description": "MQTT connection reason codes, see MQTT v5 table 3-1 for values. note that -1 indicates 'not yet connected' ", 124 | "type": "integer" 125 | }, 126 | "rt" : { 127 | "description": "Resource Type of the Resource", 128 | "items": { 129 | "enum": ["oic.r.mqtt.conf"], 130 | "type": "string", 131 | "maxLength": 64 132 | }, 133 | "minItems": 1, 134 | "uniqueItems": true, 135 | "readOnly": true, 136 | "type": "array" 137 | }, 138 | "id" : { 139 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 140 | }, 141 | "n" : { 142 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 143 | }, 144 | "if" : { 145 | "description": "The OCF Interfaces supported by this Resource", 146 | "items": { 147 | "enum": [ 148 | "oic.if.rw", 149 | "oic.if.baseline" 150 | ], 151 | "type": "string", 152 | "maxLength": 64 153 | }, 154 | "minItems": 1, 155 | "readOnly": true, 156 | "uniqueItems": true, 157 | "type": "array" 158 | } 159 | }, 160 | "type" : "object", 161 | "required": ["server", "port"] 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /swagger2.0/oic.wk.atomicmeasurement.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Atomic Measurement links list representation", 5 | "version": "2019-03-04", 6 | "license": { 7 | "name": "OCF Data Model License", 8 | "url": "https://openconnectivityfoundation.github.io/core/LICENSE.md", 9 | "x-copyright": "Copyright 2018-2019 Open Connectivity Foundation, Inc. All rights reserved." 10 | }, 11 | "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" 12 | }, 13 | "schemes": ["http"], 14 | "consumes": ["application/json"], 15 | "produces": ["application/json"], 16 | "paths": { 17 | "/AtomicMeasurementResURI?if=oic.if.ll": { 18 | "get": { 19 | "description": "The oic.if.ll OCF Interface exposes a representation of the Links", 20 | "parameters": [ 21 | { 22 | "$ref": "#/parameters/interface-all" 23 | } 24 | ], 25 | "responses": { 26 | "200": { 27 | "description": "", 28 | "x-example": [{ 29 | "href": "/temperature", 30 | "rt": ["oic.r.temperature"], 31 | "if": ["oic.if.s", "oic.if.baseline"] 32 | }, 33 | { 34 | "href": "/bodylocation", 35 | "rt": ["oic.r.body.location.temperature"], 36 | "if": ["oic.if.s", "oic.if.baseline"] 37 | }, 38 | { 39 | "href": "/timestamp", 40 | "rt": ["oic.r.time.stamp"], 41 | "if": ["oic.if.s", "oic.if.baseline"] 42 | }], 43 | "schema": { 44 | "$ref": "#/definitions/links" 45 | } 46 | } 47 | } 48 | } 49 | }, 50 | "/AtomicMeasurementResURI?if=oic.if.b": { 51 | "get": { 52 | "description": "The oic.if.b OCF Interface returns data items retrieved from Resources pointed to by the Links.\n", 53 | "parameters": [ 54 | { 55 | "$ref": "#/parameters/interface-all" 56 | } 57 | ], 58 | "responses": { 59 | "200": { 60 | "description": "Normal response, no errors, all Properties are returned correctly\n", 61 | "x-example": [{ 62 | "href": "/temperature", 63 | "rep": { 64 | "temperature": 38, 65 | "units": "C", 66 | "range": [25, 45] 67 | } 68 | }, 69 | { 70 | "href": "/bodylocation", 71 | "rep": { 72 | "bloc": "ear" 73 | } 74 | }, 75 | { 76 | "href": "/timestamp", 77 | "rep": { 78 | "timestamp": "2007-04-05T14:30+09:00" 79 | } 80 | }], 81 | "schema": { 82 | "$ref": "#/definitions/batch-retrieve" 83 | } 84 | } 85 | } 86 | } 87 | }, 88 | "/AtomicMeasurementResURI?if=oic.if.baseline": { 89 | "get": { 90 | "description": "The oic.if.baseline OCF Interface exposes a representation of the links and\nthe Common Properties of the Atomic Measurement Resource.\n", 91 | "parameters": [ 92 | { 93 | "$ref": "#/parameters/interface-all" 94 | } 95 | ], 96 | "responses": { 97 | "200": { 98 | "description": "", 99 | "x-example": { 100 | "rt": ["oic.wk.atomicmeasurement"], 101 | "if": ["oic.if.b", "oic.if.ll", "oic.if.baseline"], 102 | "rts": ["oic.r.temperature", "oic.r.body.location.temperature", "oic.r.time.stamp"], 103 | "rts-m": ["oic.r.temperature", "oic.r.body.location.temperature", "oic.r.time.stamp"], 104 | "links": [{ 105 | "href": "/temperature", 106 | "rt": ["oic.r.temperature"], 107 | "if": ["oic.if.s", "oic.if.baseline"] 108 | }, 109 | { 110 | "href": "/bodylocation", 111 | "rt": ["oic.r.body.location.temperature"], 112 | "if": ["oic.if.s", "oic.if.baseline"] 113 | }, 114 | { 115 | "href": "/timestamp", 116 | "rt": ["oic.r.time.stamp"], 117 | "if": ["oic.if.s", "oic.if.baseline"] 118 | }] 119 | }, 120 | "schema": { 121 | "$ref": "#/definitions/baseline" 122 | } 123 | } 124 | } 125 | } 126 | } 127 | }, 128 | "parameters": { 129 | "interface-all": { 130 | "in": "query", 131 | "name": "if", 132 | "type": "string", 133 | "enum": ["oic.if.b", "oic.if.ll", "oic.if.baseline"] 134 | } 135 | }, 136 | "definitions": { 137 | "links": { 138 | "type": "array", 139 | "items": { 140 | "$ref": "#/definitions/oic.oic-link" 141 | } 142 | }, 143 | "batch-retrieve": { 144 | "title": "Collection Batch Retrieve Format (auto merged)", 145 | "minItems": 1, 146 | "items": { 147 | "additionalProperties": true, 148 | "properties": { 149 | "href": { 150 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 151 | }, 152 | "rep": { 153 | "oneOf": [{ 154 | "description": "The response payload from a single Resource", 155 | "type": "object" 156 | }, 157 | { 158 | "description": " The response payload from a Collection (batch) Resource", 159 | "items": { 160 | "properties": { 161 | "anchor": { 162 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/anchor" 163 | }, 164 | "di": { 165 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/di" 166 | }, 167 | "eps": { 168 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/eps" 169 | }, 170 | "href": { 171 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 172 | }, 173 | "if": { 174 | "description": "The OCF Interface set supported by this Resource", 175 | "items": { 176 | "enum": [ 177 | "oic.if.baseline", 178 | "oic.if.ll", 179 | "oic.if.b", 180 | "oic.if.rw", 181 | "oic.if.r", 182 | "oic.if.a", 183 | "oic.if.s"], 184 | "type": "string" 185 | }, 186 | "minItems": 1, 187 | "uniqueItems": true, 188 | "type": "array" 189 | }, 190 | "ins": { 191 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/ins" 192 | }, 193 | "p": { 194 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/p" 195 | }, 196 | "rel": { 197 | "description": "The relation of the target URI referenced by the Link to the context URI", 198 | "oneOf": [ 199 | { 200 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_array" 201 | }, 202 | { 203 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_string" 204 | } 205 | ] 206 | }, 207 | "rt": { 208 | "description": "Resource Type of the Resource", 209 | "items": { 210 | "maxLength": 64, 211 | "type": "string" 212 | }, 213 | "minItems": 1, 214 | "uniqueItems": true, 215 | "type": "array" 216 | }, 217 | "title": { 218 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/title" 219 | }, 220 | "type": { 221 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/type" 222 | } 223 | }, 224 | "required": [ 225 | "href", 226 | "rt", 227 | "if" 228 | ], 229 | "type": "object" 230 | }, 231 | "type": "array" 232 | }] 233 | } 234 | }, 235 | "required": [ 236 | "href", 237 | "rep" 238 | ], 239 | "type": "object" 240 | }, 241 | "type": "array" 242 | }, 243 | "baseline": { 244 | "properties": { 245 | "links": { 246 | "description": "A set of simple or individual Links.", 247 | "items": { 248 | "$ref": "#/definitions/oic.oic-link" 249 | }, 250 | "type": "array" 251 | }, 252 | "n": { "$ref" : "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n"}, 253 | "id": { "$ref" : "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id"}, 254 | "rt": { 255 | "description": "Resource Type of this Resource", 256 | "items": { 257 | "enum": ["oic.wk.atomicmeasurement"], 258 | "type": "string", 259 | "maxLength": 64 260 | }, 261 | "minItems": 1, 262 | "readOnly": true, 263 | "uniqueItems": true, 264 | "type": "array" 265 | }, 266 | "rts": { 267 | "description": "An array of Resource Types that are supported within an array of Links exposed by the Resource", 268 | "items": { 269 | "maxLength": 64, 270 | "type": "string" 271 | }, 272 | "minItems": 1, 273 | "readOnly": true, 274 | "uniqueItems": true, 275 | "type": "array" 276 | }, 277 | "rts-m": { 278 | "description": "An array of Resource Types that are mandatory to be exposed within an array of Links exposed by the Resource", 279 | "items": { 280 | "maxLength": 64, 281 | "type": "string" 282 | }, 283 | "minItems": 1, 284 | "readOnly": true, 285 | "uniqueItems": true, 286 | "type": "array" 287 | }, 288 | "if": { 289 | "description": "The OCF Interface set supported by this Resource", 290 | "items": { 291 | "enum": ["oic.if.b", "oic.if.ll", "oic.if.baseline"], 292 | "type": "string" 293 | }, 294 | "minItems": 3, 295 | "readOnly": true, 296 | "uniqueItems": true, 297 | "type": "array" 298 | } 299 | }, 300 | "type": "object", 301 | "required": [ 302 | "rt", 303 | "if", 304 | "links" 305 | ] 306 | }, 307 | "oic.oic-link": { 308 | "properties": { 309 | "anchor": { 310 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/anchor" 311 | }, 312 | "di": { 313 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/di" 314 | }, 315 | "eps": { 316 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/eps" 317 | }, 318 | "href": { 319 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 320 | }, 321 | "if": { 322 | "description": "The OCF Interface set supported by this Resource", 323 | "items": { 324 | "enum": [ 325 | "oic.if.baseline", 326 | "oic.if.ll", 327 | "oic.if.b", 328 | "oic.if.rw", 329 | "oic.if.r", 330 | "oic.if.a", 331 | "oic.if.s"], 332 | "type": "string" 333 | }, 334 | "minItems": 1, 335 | "uniqueItems": true, 336 | "type": "array" 337 | }, 338 | "ins": { 339 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/ins" 340 | }, 341 | "p": { 342 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/p" 343 | }, 344 | "rel": { 345 | "description": "The relation of the target URI referenced by the Link to the context URI", 346 | "oneOf": [ 347 | { 348 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_array" 349 | }, 350 | { 351 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_string" 352 | } 353 | ] 354 | }, 355 | "rt": { 356 | "description": "Resource Type of the Resource", 357 | "items": { 358 | "maxLength": 64, 359 | "type": "string" 360 | }, 361 | "minItems": 1, 362 | "uniqueItems": true, 363 | "type": "array" 364 | }, 365 | "title": { 366 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/title" 367 | }, 368 | "type": { 369 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/type" 370 | } 371 | }, 372 | "required": [ 373 | "href", 374 | "rt", 375 | "if" 376 | ], 377 | "type": "object" 378 | } 379 | } 380 | } 381 | -------------------------------------------------------------------------------- /swagger2.0/oic.wk.col.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Collection", 5 | "version": "2019-03-04", 6 | "license": { 7 | "name": "OCF Data Model License", 8 | "url": "https://openconnectivityfoundation.github.io/core/LICENSE.md", 9 | "x-copyright": "Copyright 2016-2019 Open Connectivity Foundation, Inc. All rights reserved." 10 | }, 11 | "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" 12 | }, 13 | "schemes": [ 14 | "http" 15 | ], 16 | "consumes": [ 17 | "application/json" 18 | ], 19 | "produces": [ 20 | "application/json" 21 | ], 22 | "paths": { 23 | "/CollectionResURI?if=oic.if.ll" : { 24 | "get": { 25 | "description": "Collection Resource Type contains Properties and Links.\nThe oic.if.ll OCF Interface exposes a representation of the Links\n", 26 | "parameters": [ 27 | { 28 | "$ref": "#/parameters/interface-all" 29 | } 30 | ], 31 | "responses": { 32 | "200": { 33 | "description" : "", 34 | "x-example": [ 35 | { 36 | "href": "/switch", 37 | "rt": ["oic.r.switch.binary"], 38 | "if": ["oic.if.a", "oic.if.baseline"], 39 | "eps": [ 40 | {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, 41 | {"ep": "coaps://[fe80::b1d6]:1122"}, 42 | {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} 43 | ] 44 | }, 45 | { 46 | "href": "/airFlow", 47 | "rt": ["oic.r.airflow"], 48 | "if": ["oic.if.a", "oic.if.baseline"], 49 | "eps": [ 50 | {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, 51 | {"ep": "coaps://[fe80::b1d6]:1122"}, 52 | {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} 53 | ] 54 | } 55 | ], 56 | "schema": { 57 | "$ref": "#/definitions/slinks" 58 | } 59 | } 60 | } 61 | } 62 | }, 63 | "/CollectionResURI?if=oic.if.baseline" : { 64 | "get": { 65 | "description": "Collection Resource Type contains Properties and Links.\nThe oic.if.baseline OCF Interface exposes a representation of\nthe Links and the Properties of the Collection Resource itself\n", 66 | "parameters": [ 67 | { 68 | "$ref": "#/parameters/interface-all" 69 | } 70 | ], 71 | "responses": { 72 | "200": { 73 | "description" : "", 74 | "x-example": { 75 | "rt": ["oic.wk.col"], 76 | "if": ["oic.if.ll", "oic.if.b", "oic.if.baseline"], 77 | "rts": [ "oic.r.switch.binary", "oic.r.airflow" ], 78 | "rts-m": [ "oic.r.switch.binary" ], 79 | "links": [ 80 | { 81 | "href": "/switch", 82 | "rt": ["oic.r.switch.binary"], 83 | "if": ["oic.if.a", "oic.if.baseline"], 84 | "eps": [ 85 | {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, 86 | {"ep": "coaps://[fe80::b1d6]:1122"}, 87 | {"ep": "coaps+tcp://[2001:db8:a::123]:2222", "pri": 3} 88 | ] 89 | }, 90 | { 91 | "href": "/airFlow", 92 | "rt": ["oic.r.airflow"], 93 | "if": ["oic.if.a", "oic.if.baseline"], 94 | "eps": [ 95 | {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, 96 | {"ep": "coaps://[fe80::b1d6]:1122"}, 97 | {"ep": "coaps+tcp://[2001:db8:a::123]:2222", "pri": 3} 98 | ] 99 | } 100 | ] 101 | }, 102 | "schema": { 103 | "$ref": "#/definitions/sbaseline" 104 | } 105 | } 106 | } 107 | }, 108 | "post": { 109 | "description": "Update on Baseline OCF Interface\n", 110 | "parameters": [ 111 | { 112 | "$ref": "#/parameters/interface-update" 113 | }, 114 | { 115 | "name": "body", 116 | "in": "body", 117 | "required": true, 118 | "schema": { 119 | "$ref": "#/definitions/sbaseline-update" 120 | } 121 | } 122 | ], 123 | "responses": { 124 | "200": { 125 | "description" : "", 126 | "schema": { 127 | "$ref": "#/definitions/sbaseline" 128 | } 129 | } 130 | } 131 | } 132 | }, 133 | "/CollectionResURI?if=oic.if.b" : { 134 | "get": { 135 | "description": "Collection Resource Type contains Properties and Links.\nThe oic.if.b OCF Interfacce exposes a composite representation of the\nResources pointed to by the Links\n", 136 | "parameters": [ 137 | { 138 | "$ref": "#/parameters/interface-all" 139 | } 140 | ], 141 | "responses": { 142 | "200": { 143 | "description" : "All targets returned OK status", 144 | "x-example": [ 145 | { 146 | "href": "/switch", 147 | "rep": { 148 | "value": true 149 | } 150 | }, 151 | { 152 | "href": "/airFlow", 153 | "rep": { 154 | "direction": "floor", 155 | "speed": 3 156 | } 157 | } 158 | ], 159 | "schema": { 160 | "$ref": "#/definitions/sbatch-retrieve" 161 | } 162 | }, 163 | "404": { 164 | "description" : "One or more targets did not return an OK status, return a representation containing returned Properties from the targets that returned OK", 165 | "x-example": [ 166 | { 167 | "href": "/switch", 168 | "rep": { 169 | "value": true 170 | } 171 | } 172 | ], 173 | "schema": { 174 | "$ref": "#/definitions/sbatch-retrieve" 175 | } 176 | } 177 | } 178 | }, 179 | "post": { 180 | "description": "Update on Batch OCF Interface\n", 181 | "parameters": [ 182 | { 183 | "$ref": "#/parameters/interface-update" 184 | }, 185 | { 186 | "name": "body", 187 | "in": "body", 188 | "required": true, 189 | "schema": { 190 | "$ref": "#/definitions/sbatch-update" 191 | }, 192 | "x-example": [ 193 | { 194 | "href": "/switch", 195 | "rep": { 196 | "value": true 197 | } 198 | }, 199 | { 200 | "href": "/airFlow", 201 | "rep": { 202 | "direction": "floor", 203 | "speed": 3 204 | } 205 | } 206 | ] 207 | } 208 | ], 209 | "responses": { 210 | "200": { 211 | "description" : "All targets returned OK status, return a representation of the current state of all targets", 212 | "x-example": [ 213 | { 214 | "href": "/switch", 215 | "rep": { 216 | "value": true 217 | } 218 | }, 219 | { 220 | "href": "/airFlow", 221 | "rep": { 222 | "direction": "demist", 223 | "speed": 5 224 | } 225 | } 226 | ], 227 | "schema": { 228 | "$ref": "#/definitions/sbatch-retrieve" 229 | } 230 | }, 231 | "403": { 232 | "description" : "One or more targets did not return OK status; return a retrieve representation of the current state of all targets in the batch", 233 | "x-example": [ 234 | { 235 | "href": "/switch", 236 | "rep": { 237 | "value": true 238 | } 239 | }, 240 | { 241 | "href": "/airFlow", 242 | "rep": { 243 | "direction": "floor", 244 | "speed": 3 245 | } 246 | } 247 | ], 248 | "schema": { 249 | "$ref": "#/definitions/sbatch-retrieve" 250 | } 251 | } 252 | } 253 | } 254 | } 255 | }, 256 | "parameters": { 257 | "interface-all" : { 258 | "in" : "query", 259 | "name" : "if", 260 | "type" : "string", 261 | "enum" : ["oic.if.ll", "oic.if.b", "oic.if.baseline"] 262 | }, 263 | "interface-update" : { 264 | "in" : "query", 265 | "name" : "if", 266 | "type" : "string", 267 | "enum" : ["oic.if.b", "oic.if.baseline"] 268 | } 269 | }, 270 | "definitions": { 271 | "sbaseline" : { 272 | "properties": { 273 | "links" : { 274 | "description": "A set of simple or individual Links.", 275 | "items": { 276 | "$ref": "#/definitions/oic.oic-link" 277 | }, 278 | "type": "array" 279 | }, 280 | "n": { 281 | "$ref" : "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 282 | }, 283 | "id": { 284 | "$ref" : "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 285 | }, 286 | "rt": { 287 | "$ref": "#/definitions/oic.core.rt-col" 288 | }, 289 | "rts": { 290 | "$ref": "#/definitions/oic.core.rt" 291 | }, 292 | "rts-m": { 293 | "$ref": "#/definitions/oic.core.rt" 294 | }, 295 | "if": { 296 | "description": "The OCF Interfaces supported by this Resource", 297 | "items": { 298 | "enum": [ 299 | "oic.if.ll", 300 | "oic.if.baseline", 301 | "oic.if.b" 302 | ], 303 | "type": "string", 304 | "maxLength": 64 305 | }, 306 | "minItems": 2, 307 | "uniqueItems": true, 308 | "readOnly": true, 309 | "type": "array" 310 | } 311 | }, 312 | "additionalProperties": true, 313 | "type" : "object", 314 | "required": [ 315 | "rt", 316 | "if", 317 | "links" 318 | ] 319 | }, 320 | "sbaseline-update": { 321 | "additionalProperties": true 322 | }, 323 | "oic.core.rt-col": { 324 | "description": "Resource Type of the Resource", 325 | "items": { 326 | "enum": ["oic.wk.col"], 327 | "type": "string", 328 | "maxLength": 64 329 | }, 330 | "minItems": 1, 331 | "uniqueItems": true, 332 | "readOnly": true, 333 | "type": "array" 334 | }, 335 | "oic.core.rt": { 336 | "description": "Resource Type or set of Resource Types", 337 | "items": { 338 | "type": "string", 339 | "maxLength": 64 340 | }, 341 | "minItems": 1, 342 | "uniqueItems": true, 343 | "readOnly": true, 344 | "type": "array" 345 | }, 346 | "sbatch-retrieve" : { 347 | "minItems" : 1, 348 | "items" : { 349 | "additionalProperties": true, 350 | "properties": { 351 | "href": { 352 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 353 | }, 354 | "rep": { 355 | "oneOf": [ 356 | { 357 | "description": "The response payload from a single Resource", 358 | "type": "object" 359 | }, 360 | { 361 | "description": " The response payload from a Collection (batch) Resource", 362 | "items": { 363 | "$ref": "#/definitions/oic.oic-link" 364 | }, 365 | "type": "array" 366 | } 367 | ] 368 | } 369 | }, 370 | "required": [ 371 | "href", 372 | "rep" 373 | ], 374 | "type": "object" 375 | }, 376 | "type" : "array" 377 | }, 378 | "sbatch-update" : { 379 | "title" : "Collection Batch Update Format", 380 | "minItems" : 1, 381 | "items" : { 382 | "$ref": "#/definitions/sbatch-update.item" 383 | }, 384 | "type" : "array" 385 | }, 386 | "sbatch-update.item" : { 387 | "additionalProperties": true, 388 | "description": "Array of Resource representations to apply to the batch Collection, using href to indicate which Resource(s) in the batch to update. If the href Property is empty, effectively making the URI reference to the Collection itself, the representation is to be applied to all Resources in the batch", 389 | "properties": { 390 | "href": { 391 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 392 | }, 393 | "rep": { 394 | "oneOf": [ 395 | { 396 | "description": "The payload for a single Resource", 397 | "type": "object" 398 | }, 399 | { 400 | "description": " The payload for a Collection (batch) Resource", 401 | "items": { 402 | "$ref": "#/definitions/oic.oic-link" 403 | }, 404 | "type": "array" 405 | } 406 | ] 407 | } 408 | }, 409 | "required": [ 410 | "href", 411 | "rep" 412 | ], 413 | "type": "object" 414 | }, 415 | "slinks" : { 416 | "type" : "array", 417 | "items" : { 418 | "$ref": "#/definitions/oic.oic-link" 419 | } 420 | }, 421 | "oic.oic-link": { 422 | "properties": { 423 | "if": { 424 | "description": "The OCF Interfaces supported by the Linked target", 425 | "items": { 426 | "enum": [ 427 | "oic.if.baseline", 428 | "oic.if.ll", 429 | "oic.if.b", 430 | "oic.if.rw", 431 | "oic.if.r", 432 | "oic.if.a", 433 | "oic.if.s" 434 | ], 435 | "type": "string", 436 | "maxLength": 64 437 | }, 438 | "minItems": 1, 439 | "uniqueItems": true, 440 | "readOnly": true, 441 | "type": "array" 442 | }, 443 | "rt": { 444 | "$ref": "#/definitions/oic.core.rt" 445 | }, 446 | "anchor": { 447 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/anchor" 448 | }, 449 | "di": { 450 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/di" 451 | }, 452 | "eps": { 453 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/eps" 454 | }, 455 | "href": { 456 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 457 | }, 458 | "ins": { 459 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/ins" 460 | }, 461 | "p": { 462 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/p" 463 | }, 464 | "rel": { 465 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_array" 466 | }, 467 | "title": { 468 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/title" 469 | }, 470 | "type": { 471 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/type" 472 | }, 473 | "tag-pos-desc": { 474 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/tag-pos-desc" 475 | }, 476 | "tag-pos-rel": { 477 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/tag-pos-rel" 478 | }, 479 | "tag-func-desc": { 480 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/tag-func-desc" 481 | } 482 | }, 483 | "required": [ 484 | "href", 485 | "rt", 486 | "if" 487 | ], 488 | "type": "object" 489 | } 490 | } 491 | } 492 | -------------------------------------------------------------------------------- /swagger2.0/oic.wk.d.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Device", 5 | "version": "2019-03-13", 6 | "license": { 7 | "name": "OCF Data Model License", 8 | "url": "https://openconnectivityfoundation.github.io/core/LICENSE.md", 9 | "x-copyright": "Copyright 2016-2019 Open Connectivity Foundation, Inc. All rights reserved." 10 | }, 11 | "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" 12 | }, 13 | "schemes": [ 14 | "http" 15 | ], 16 | "consumes": [ 17 | "application/json" 18 | ], 19 | "produces": [ 20 | "application/json" 21 | ], 22 | "paths": { 23 | "/oic/d" : { 24 | "get": { 25 | "description": "Known Resource that is hosted by every Server.\nAllows for logical Device specific information to be discovered.\n", 26 | "parameters": [ 27 | { 28 | "$ref": "#/parameters/interface" 29 | } 30 | ], 31 | "responses": { 32 | "200": { 33 | "description": "", 34 | "x-example": 35 | { 36 | "n": "Device 1", 37 | "rt": ["oic.wk.d"], 38 | "di": "54919CA5-4101-4AE4-595B-353C51AA983C", 39 | "icv": "ocf.2.0.2", 40 | "dmv": "ocf.res.1.0.0, ocf.sh.1.0.0", 41 | "piid": "6F0AAC04-2BB0-468D-B57C-16570A26AE48" 42 | }, 43 | "schema": { 44 | "$ref": "#/definitions/Device" 45 | } 46 | } 47 | } 48 | } 49 | } 50 | }, 51 | "parameters": { 52 | "interface" : { 53 | "in": "query", 54 | "name": "if", 55 | "type": "string", 56 | "enum": ["oic.if.r", "oic.if.baseline"] 57 | } 58 | }, 59 | "definitions": { 60 | "Device": { 61 | "properties": { 62 | "rt": { 63 | "description": "Resource Type of the Resource", 64 | "items": { 65 | "type": "string", 66 | "maxLength": 64 67 | }, 68 | "minItems": 1, 69 | "readOnly": true, 70 | "uniqueItems": true, 71 | "type": "array" 72 | }, 73 | "ld": { 74 | "description": "Localized Descriptions.", 75 | "items": { 76 | "properties": { 77 | "language": { 78 | "allOf": [ 79 | { 80 | "$ref" : "http://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/language-tag" 81 | }, 82 | { 83 | "description": "An RFC 5646 language tag.", 84 | "readOnly": true 85 | } 86 | ] 87 | }, 88 | "value": { 89 | "description": "Device description in the indicated language.", 90 | "maxLength": 64, 91 | "readOnly": true, 92 | "type": "string" 93 | } 94 | }, 95 | "type": "object" 96 | }, 97 | "minItems": 1, 98 | "readOnly": true, 99 | "type": "array" 100 | }, 101 | "piid": { 102 | "allOf": [ 103 | { 104 | "$ref" : "http://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/uuid" 105 | }, 106 | { 107 | "description": "Protocol independent unique identifier for the Device that is immutable.", 108 | "readOnly": true 109 | } 110 | ] 111 | }, 112 | "di": { 113 | "allOf": [ 114 | { 115 | "$ref" : "http://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/uuid" 116 | }, 117 | { 118 | "description": "Unique identifier for the Device", 119 | "readOnly": true 120 | } 121 | ] 122 | }, 123 | "dmno": { 124 | "description": "Model number as designated by manufacturer.", 125 | "maxLength": 64, 126 | "readOnly": true, 127 | "type": "string" 128 | }, 129 | "sv": { 130 | "description": "Software version.", 131 | "maxLength": 64, 132 | "readOnly": true, 133 | "type": "string" 134 | }, 135 | "dmn": { 136 | "description": "Manufacturer Name.", 137 | "items": { 138 | "properties": { 139 | "language": { 140 | "allOf": [ 141 | { 142 | "$ref" : "http://openconnectivityfoundation.github.io/core/schemas/oic.types-schema.json#/definitions/language-tag" 143 | }, 144 | { 145 | "description": "An RFC 5646 language tag.", 146 | "readOnly": true 147 | } 148 | ] 149 | }, 150 | "value": { 151 | "description": "Manufacturer name in the indicated language.", 152 | "maxLength": 64, 153 | "readOnly": true, 154 | "type": "string" 155 | } 156 | }, 157 | "type": "object" 158 | }, 159 | "minItems": 1, 160 | "readOnly": true, 161 | "type": "array" 162 | }, 163 | "icv": { 164 | "description": "The version of the Device", 165 | "maxLength": 64, 166 | "readOnly": true, 167 | "type": "string" 168 | }, 169 | "dmv": { 170 | "description": "Specification versions of the Resource and Device Specifications to which this device data model is implemented", 171 | "maxLength": 256, 172 | "readOnly": true, 173 | "type": "string" 174 | }, 175 | "n": { 176 | "$ref" : "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 177 | }, 178 | "id": { 179 | "$ref" : "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 180 | }, 181 | "if": { 182 | "description": "The OCF Interfacces supported by this Resource", 183 | "items": { 184 | "enum": [ 185 | "oic.if.r", 186 | "oic.if.baseline" 187 | ], 188 | "type": "string", 189 | "maxLength": 64 190 | }, 191 | "minItems": 2, 192 | "uniqueItems": true, 193 | "readOnly": true, 194 | "type": "array" 195 | }, 196 | "econame" : { 197 | "description": "Ecosystem Name of the Bridged Device which is exposed by this VOD.", 198 | "type": "string", 199 | "enum": ["BLE", "oneM2M", "UPlus", "Zigbee", "Z-Wave"], 200 | "readOnly": true 201 | }, 202 | "ecoversion" : { 203 | "description": "Version of ecosystem that a Bridged Device belongs to. Typical version string format is like n.n (e.g. 5.0).", 204 | "type": "string", 205 | "maxLength": 64, 206 | "readOnly": true 207 | } 208 | }, 209 | "type": "object", 210 | "required": ["n", "di", "icv", "dmv", "piid"] 211 | } 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /swagger2.0/oic.wk.introspection.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Introspection Resource", 5 | "version": "2019-03-04", 6 | "license": { 7 | "name": "OCF Data Model License", 8 | "url": "https://openconnectivityfoundation.github.io/core/LICENSE.md", 9 | "x-copyright": "Copyright 2016-2019 Open Connectivity Foundation, Inc. All rights reserved." 10 | }, 11 | "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" 12 | }, 13 | "schemes": [ 14 | "http" 15 | ], 16 | "consumes": [ 17 | "application/json" 18 | ], 19 | "produces": [ 20 | "application/json" 21 | ], 22 | "paths": { 23 | "/IntrospectionResURI": { 24 | "get": { 25 | "description": "This Resource provides the means to get the Introspection Device Data (IDD) specifying all the OCF Endpoints of the Device.\nThe url hosted by this Resource is either a local or an external url.\n", 26 | "parameters": [ 27 | { 28 | "$ref": "#/parameters/interface" 29 | } 30 | ], 31 | "responses": { 32 | "200": { 33 | "description": "", 34 | "x-example": { 35 | "rt": ["oic.wk.introspection"], 36 | "urlInfo": [ 37 | { 38 | "content-type": "application/cbor", 39 | "protocol": "coap", 40 | "url": "coap://[fe80::1]:1234/IntrospectionExampleURI" 41 | } 42 | ] 43 | }, 44 | "schema": { 45 | "$ref": "#/definitions/oic.wk.introspectionInfo" 46 | } 47 | } 48 | } 49 | } 50 | } 51 | }, 52 | "parameters": { 53 | "interface": { 54 | "in": "query", 55 | "name": "if", 56 | "type": "string", 57 | "enum": ["oic.if.r", "oic.if.baseline"] 58 | } 59 | }, 60 | "definitions": { 61 | "oic.wk.introspectionInfo": { 62 | "properties": { 63 | "rt": { 64 | "description": "Resource Type of the Resource", 65 | "items": { 66 | "enum": ["oic.wk.introspection"], 67 | "type": "string", 68 | "maxLength": 64 69 | }, 70 | "minItems": 1, 71 | "readOnly": true, 72 | "uniqueItems": true, 73 | "type": "array" 74 | }, 75 | "n": { 76 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 77 | }, 78 | "urlInfo": { 79 | "description": "Information on the location of the Introspection Device Data (IDD).", 80 | "items": { 81 | "properties": { 82 | "content-type": { 83 | "default": "application/cbor", 84 | "description": "content-type of the Introspection Device Data", 85 | "enum": [ 86 | "application/json", 87 | "application/cbor" 88 | ], 89 | "type": "string" 90 | }, 91 | "protocol": { 92 | "description": "Identifier for the protocol to be used to obtain the Introspection Device Data", 93 | "enum": [ 94 | "coap", 95 | "coaps", 96 | "http", 97 | "https", 98 | "coap+tcp", 99 | "coaps+tcp" 100 | ], 101 | "type": "string" 102 | }, 103 | "url": { 104 | "description": "The URL of the Introspection Device Data.", 105 | "format": "uri", 106 | "type": "string" 107 | }, 108 | "version": { 109 | "default": 1, 110 | "description": "The version of the Introspection Device Data that can be downloaded", 111 | "enum": [ 112 | 1 113 | ], 114 | "type": "integer" 115 | } 116 | }, 117 | "required": [ 118 | "url", 119 | "protocol" 120 | ], 121 | "type": "object" 122 | }, 123 | "minItems": 1, 124 | "readOnly": true, 125 | "type": "array" 126 | }, 127 | "id": { 128 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 129 | }, 130 | "if": { 131 | "description": "The OCF Interfaces supported by this Resource", 132 | "items": { 133 | "enum": [ 134 | "oic.if.r", 135 | "oic.if.baseline" 136 | ], 137 | "type": "string", 138 | "maxLength": 64 139 | }, 140 | "minItems": 2, 141 | "readOnly": true, 142 | "uniqueItems": true, 143 | "type": "array" 144 | } 145 | }, 146 | "type" : "object", 147 | "required": ["urlInfo"] 148 | } 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /swagger2.0/oic.wk.p.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Platform", 5 | "version": "2021-02-02", 6 | "license": { 7 | "name": "OCF Data Model License", 8 | "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", 9 | "x-copyright": "Copyright 2016-2019, 2021 Open Connectivity Foundation, Inc. All rights reserved." 10 | }, 11 | "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" 12 | }, 13 | "schemes": ["http"], 14 | "consumes": ["application/json"], 15 | "produces": ["application/json"], 16 | "paths": { 17 | "/oic/p" : { 18 | "get": { 19 | "description": "Known Resource that is defines the Platform on which an Server is hosted.\nAllows for Platform specific information to be discovered.\n", 20 | "parameters": [ 21 | {"$ref": "#/parameters/interface"} 22 | ], 23 | "responses": { 24 | "200": { 25 | "description" : "", 26 | "x-example": { 27 | "pi": "54919CA5-4101-4AE4-595B-353C51AA983C", 28 | "rt": ["oic.wk.p"], 29 | "mnmn": "Acme, Inc" 30 | }, 31 | "schema": { "$ref": "#/definitions/Platform" } 32 | } 33 | } 34 | } 35 | } 36 | }, 37 | "parameters": { 38 | "interface" : { 39 | "in" : "query", 40 | "name" : "if", 41 | "type" : "string", 42 | "enum" : ["oic.if.r", "oic.if.baseline"] 43 | } 44 | }, 45 | "definitions": { 46 | "Platform" : { 47 | "properties": { 48 | "rt" : { 49 | "description": "Resource Type of the Resource", 50 | "items": { 51 | "enum": ["oic.wk.p"], 52 | "type": "string", 53 | "maxLength": 64 54 | }, 55 | "minItems": 1, 56 | "uniqueItems": true, 57 | "readOnly": true, 58 | "type": "array" 59 | }, 60 | "pi" : { 61 | "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$", 62 | "type": "string", 63 | "description": "Platform Identifier", 64 | "readOnly": true 65 | }, 66 | "mnfv" : { 67 | "description": "Manufacturer's firmware version", 68 | "maxLength": 64, 69 | "readOnly": true, 70 | "type": "string" 71 | }, 72 | "vid" : { 73 | "description": "Manufacturer's defined information for the Platform. The content is freeform, with population rules up to the manufacturer", 74 | "maxLength": 64, 75 | "readOnly": true, 76 | "type": "string" 77 | }, 78 | "mnmn" : { 79 | "description": "Manufacturer name", 80 | "maxLength": 64, 81 | "readOnly": true, 82 | "type": "string" 83 | }, 84 | "mnmo" : { 85 | "description": "Model number as designated by the manufacturer", 86 | "maxLength": 128, 87 | "readOnly": true, 88 | "type": "string" 89 | }, 90 | "mnhw" : { 91 | "description": "Platform Hardware Version", 92 | "maxLength": 64, 93 | "readOnly": true, 94 | "type": "string" 95 | }, 96 | "mnos" : { 97 | "description": "Platform Resident OS Version", 98 | "maxLength": 64, 99 | "readOnly": true, 100 | "type": "string" 101 | }, 102 | "mndt" : { 103 | "pattern": "^([0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|2[0-9]|1[0-9]|0[1-9])$", 104 | "type": "string", 105 | "description": "Manufacturing Date.", 106 | "readOnly": true 107 | }, 108 | "id" : { 109 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 110 | }, 111 | "mnsl" : { 112 | "description": "Manufacturer's Support Information URL", 113 | "format": "uri", 114 | "maxLength": 256, 115 | "readOnly": true, 116 | "type": "string" 117 | }, 118 | "mnpv" : { 119 | "description": "Platform Version", 120 | "maxLength": 64, 121 | "readOnly": true, 122 | "type": "string" 123 | }, 124 | "st" : { 125 | "description": "The date-time format pattern according to IETF RFC 3339.", 126 | "format": "date-time", 127 | "readOnly": true, 128 | "type": "string" 129 | }, 130 | "n" : { 131 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 132 | }, 133 | "mnml" : { 134 | "description": "Manufacturer's URL", 135 | "format": "uri", 136 | "maxLength": 256, 137 | "readOnly": true, 138 | "type": "string" 139 | }, 140 | "mnsel" : { 141 | "description": "Serial number as designated by the manufacturer", 142 | "maxLength": 64, 143 | "readOnly": true, 144 | "type": "string" 145 | }, 146 | "if" : { 147 | "description": "The OCF Interfaces supported by this Resource", 148 | "items": { 149 | "enum": [ 150 | "oic.if.r", 151 | "oic.if.baseline" 152 | ], 153 | "type": "string", 154 | "maxLength": 64 155 | }, 156 | "minItems": 2, 157 | "readOnly": true, 158 | "uniqueItems": true, 159 | "type": "array" 160 | }, 161 | "mnnct" : { 162 | "description": "An array of integers and each integer indicates the network connectivity type based on IANAIfType value as defined by: https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib, e.g., [71, 259] which represents Wi-Fi and ZigBee.", 163 | "items": { 164 | "type": "integer", 165 | "minimum": 1, 166 | "description": "The network connectivity type based on IANAIfType value as defined by: https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib." 167 | }, 168 | "minItems": 1, 169 | "readOnly": true, 170 | "type": "array" 171 | } 172 | }, 173 | "type" : "object", 174 | "required": ["pi", "mnmn"] 175 | } 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /swagger2.0/oic.wk.res.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "Discoverable Resources", 5 | "version": "2019-04-22", 6 | "license": { 7 | "name": "OCF Data Model License", 8 | "url": "https://openconnectivityfoundation.github.io/core/LICENSE.md", 9 | "x-copyright": "Copyright 2016-2019 Open Connectivity Foundation, Inc. All rights reserved." 10 | }, 11 | "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" 12 | }, 13 | "schemes": [ 14 | "http" 15 | ], 16 | "consumes": [ 17 | "application/json" 18 | ], 19 | "produces": [ 20 | "application/json" 21 | ], 22 | "paths": { 23 | "/oic/res?if=oic.if.ll": { 24 | "get": { 25 | "description": "Links list representation of /oic/res; list of discoverable Resources\n", 26 | "parameters": [ 27 | { 28 | "$ref": "#/parameters/interface-all", 29 | "$ref": "#/parameters/SecurityDomain" 30 | } 31 | ], 32 | "responses": { 33 | "200": { 34 | "description" : "", 35 | "x-example": [ 36 | { 37 | "href": "/oic/res", 38 | "rt": ["oic.wk.res"], 39 | "if": ["oic.if.ll", "oic.if.b", "oic.if.baseline"], 40 | "rel": ["self"], 41 | "p": {"bm": 3}, 42 | "eps": [ 43 | {"ep": "coaps://[fe80::b1d6]:1122"} ] 44 | }, 45 | { 46 | "href": "/humidity", 47 | "rt": ["oic.r.humidity"], 48 | "if": ["oic.if.s", "oic.if.baseline"], 49 | "p": {"bm": 3}, 50 | "eps": [ 51 | {"ep": "coaps://[fe80::b1d6]:1111", "pri": 2}, 52 | {"ep": "coaps://[fe80::b1d6]:1122"}, 53 | {"ep": "coaps+tcp://[2001:db8:a::123]:2222", "pri": 3} 54 | ] 55 | }, 56 | { 57 | "href": "/temperature", 58 | "rt": ["oic.r.temperature"], 59 | "if": ["oic.if.s", "oic.if.baseline"], 60 | "p": {"bm": 3}, 61 | "eps": [ 62 | {"ep": "coaps://[[2001:db8:a::123]:2222"} 63 | ] 64 | } 65 | ], 66 | "schema": { 67 | "$ref": "#/definitions/slinklist" 68 | } 69 | } 70 | } 71 | } 72 | }, 73 | "/oic/res?if=oic.if.b" : { 74 | "get": { 75 | "description": "Batch representation of /oic/res; list of discoverable Resources\n", 76 | "parameters": [ 77 | {"$ref": "#/parameters/interface-all"} 78 | ], 79 | "responses": { 80 | "200": { 81 | "description" : "", 82 | "x-example": [ 83 | { 84 | "href": "/humidity", 85 | "rep":{ 86 | "rt": ["oic.r.humidity"], 87 | "humidity": 40, 88 | "desiredHumidity": 40 89 | } 90 | }, 91 | { 92 | "href": "/temperature", 93 | "rep":{ 94 | "rt": ["oic.r.temperature"], 95 | "temperature": 20.0, 96 | "units": "C" 97 | } 98 | } 99 | ], 100 | "schema": { "$ref": "#/definitions/sbatch" } 101 | } 102 | } 103 | } 104 | }, 105 | "/oic/res?if=oic.if.baseline": { 106 | "get": { 107 | "description": "Baseline representation of /oic/res; list of discoverable Resources\n", 108 | "parameters": [ 109 | { 110 | "$ref": "#/parameters/interface-all", 111 | "$ref": "#/parameters/SecurityDomain" 112 | } 113 | ], 114 | "responses": { 115 | "200": { 116 | "description": "", 117 | "x-example": [ 118 | { 119 | "rt": ["oic.wk.res"], 120 | "if": ["oic.if.ll", "oic.if.b", "oic.if.baseline"], 121 | "links": [ 122 | { 123 | "href": "/humidity", 124 | "rt": ["oic.r.humidity"], 125 | "if": ["oic.if.s", "oic.if.baseline"], 126 | "p": {"bm": 3}, 127 | "eps": [ 128 | {"ep": "coaps://[fe80::b1d6]:1111", "pri": 2}, 129 | {"ep": "coaps://[fe80::b1d6]:1122"}, 130 | {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} 131 | ] 132 | }, 133 | { 134 | "href": "/temperature", 135 | "rt": ["oic.r.temperature"], 136 | "if": ["oic.if.s", "oic.if.baseline"], 137 | "p": {"bm": 3}, 138 | "eps": [ 139 | {"ep": "coaps://[[2001:db8:a::123]:2222"} 140 | ] 141 | } 142 | ] 143 | } 144 | ], 145 | "schema": { 146 | "$ref": "#/definitions/sbaseline" 147 | } 148 | } 149 | } 150 | } 151 | } 152 | }, 153 | "parameters": { 154 | "interface-all": { 155 | "in": "query", 156 | "name": "if", 157 | "type": "string", 158 | "enum": ["oic.if.ll", "oic.if.b", "oic.if.baseline"] 159 | }, 160 | "SecurityDomain": { 161 | "description": "Filter devices by Security Domain", 162 | "in": "query", 163 | "name": "sduuid", 164 | "type": "string", 165 | "format": "uuid" 166 | } 167 | }, 168 | "definitions": { 169 | "oic.oic-link": { 170 | "type": "object", 171 | "properties": { 172 | "anchor": { 173 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/anchor" 174 | }, 175 | "di": { 176 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/di" 177 | }, 178 | "eps": { 179 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/eps" 180 | }, 181 | "href": { 182 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 183 | }, 184 | "if": { 185 | "description": "The OCF Interfaces supported by the Linked Resource", 186 | "items": { 187 | "enum": [ 188 | "oic.if.baseline", 189 | "oic.if.ll", 190 | "oic.if.b", 191 | "oic.if.rw", 192 | "oic.if.r", 193 | "oic.if.a", 194 | "oic.if.s", 195 | "oic.if.w", 196 | "oic.if.startup", 197 | "oic.if.startup.revert" 198 | ], 199 | "type": "string", 200 | "maxLength": 64 201 | }, 202 | "minItems": 1, 203 | "uniqueItems": true, 204 | "type": "array" 205 | }, 206 | "ins": { 207 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/ins" 208 | }, 209 | "p": { 210 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/p" 211 | }, 212 | "rel": { 213 | "description": "The relation of the target URI referenced by the Link to the context URI", 214 | "oneOf": [ 215 | { 216 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_array" 217 | }, 218 | { 219 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_string" 220 | } 221 | ] 222 | }, 223 | "rt": { 224 | "description": "Resource Type of the Linked Resource", 225 | "items": { 226 | "maxLength": 64, 227 | "type": "string" 228 | }, 229 | "minItems": 1, 230 | "uniqueItems": true, 231 | "type": "array" 232 | }, 233 | "title": { 234 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/title" 235 | }, 236 | "type": { 237 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/type" 238 | }, 239 | "tag-pos-desc": { 240 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/tag-pos-desc" 241 | }, 242 | "tag-pos-rel": { 243 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/tag-pos-rel" 244 | }, 245 | "tag-func-desc": { 246 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/tag-func-desc" 247 | } 248 | }, 249 | "required": [ 250 | "href", 251 | "rt", 252 | "if" 253 | ] 254 | }, 255 | "slinklist": { 256 | "type" : "array", 257 | "readOnly": true, 258 | "items": { 259 | "$ref": "#/definitions/oic.oic-link" 260 | } 261 | }, 262 | "sbaseline": { 263 | "type": "array", 264 | "minItems": 1, 265 | "maxItems": 1, 266 | "items": { 267 | "type": "object", 268 | "properties": { 269 | "n": { 270 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" 271 | }, 272 | "id": { 273 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" 274 | }, 275 | "rt": { 276 | "description": "Resource Type of this Resource", 277 | "items": { 278 | "enum": ["oic.wk.res"], 279 | "type": "string", 280 | "maxLength": 64 281 | }, 282 | "minItems": 1, 283 | "readOnly": true, 284 | "uniqueItems": true, 285 | "type": "array" 286 | }, 287 | "if": { 288 | "description": "The OCF Interfaces supported by this Resource", 289 | "items": { 290 | "enum": [ 291 | "oic.if.ll", 292 | "oic.if.b", 293 | "oic.if.baseline" 294 | ], 295 | "type": "string", 296 | "maxLength": 64 297 | }, 298 | "minItems": 2, 299 | "readOnly": true, 300 | "uniqueItems": true, 301 | "type": "array" 302 | }, 303 | "links": { 304 | "type": "array", 305 | "items": { 306 | "$ref": "#/definitions/oic.oic-link" 307 | } 308 | }, 309 | "sduuid": { 310 | "description": "A UUID that identifies the Security Domain.", 311 | "type": "string", 312 | "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$", 313 | "readOnly": true 314 | }, 315 | "sdname": { 316 | "description": "Human-friendly name for the Security Domain.", 317 | "type": "string", 318 | "readOnly": true 319 | } 320 | }, 321 | "required": [ 322 | "rt", 323 | "if", 324 | "links" 325 | ] 326 | } 327 | }, 328 | "sbatch" : { 329 | "type" : "array", 330 | "minItems" : 1, 331 | "items" : { 332 | "type": "object", 333 | "additionalProperties": true, 334 | "properties": { 335 | "href": { 336 | "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" 337 | }, 338 | "rep": { 339 | "oneOf": [ 340 | { 341 | "description": "The response payload from a single Resource", 342 | "type": "object" 343 | }, 344 | { 345 | "description": " The response payload from a Collection (batch) Resource", 346 | "items": { 347 | "$ref": "#/definitions/oic.oic-link" 348 | }, 349 | "type": "array" 350 | } 351 | ] 352 | } 353 | }, 354 | "required": [ 355 | "href", 356 | "rep" 357 | ] 358 | } 359 | } 360 | } 361 | } 362 | -------------------------------------------------------------------------------- /tools/gen_sections_jakartaplus_core.bat: -------------------------------------------------------------------------------- 1 | 2 | rem ==================================================== 3 | rem batch file that creates the resource sections - Core 4 | rem ==================================================== 5 | 6 | set Template="\swagger2doc\input\ResourceTemplate.docx" 7 | 8 | rem choice of application: python or executable 9 | set cmd=python.exe \swagger2doc\src\swagger2doc.py 10 | 11 | rem make sure that correct template is used 12 | copy %Template% .\ResourceTemplate.docx 13 | 14 | rem Resources 15 | %cmd% -swagger oic.wk.atomicmeasurement.swagger.json -docx ResourceTemplate.docx -word_out am.swagger.docx -resource AtomicMeasurementResURI?if=oic.if.baseline -annex True 16 | %cmd% -swagger oic.wk.col.swagger.json -docx am.swagger.docx -word_out col.swagger.docx -resource CollectionResURI?if=oic.if.baseline -annex True 17 | %cmd% -swagger oic.wk.d.swagger.json -docx col.swagger.docx -word_out d.swagger.docx -resource oic/d -annex True -wellknown True 18 | %cmd% -swagger oic.wk.res.swagger.json -docx d.swagger.docx -word_out res.swagger.docx -resource oic/res?if=oic.if.baseline -annex True -wellknown True 19 | %cmd% -swagger oic.wk.introspection.swagger.json -docx res.swagger.docx -word_out introspection.swagger.docx -resource IntrospectionResURI -annex True -wellknown True 20 | %cmd% -swagger oic.wk.p.swagger.json -docx introspection.swagger.docx -word_out p.swagger.docx -resource oic/p -annex True -wellknown True 21 | %cmd% -swagger oic.r.mqtt.conf.swagger.json -docx p.swagger.docx -word_out mqttconf.swagger.docx -resource mqttconfResURI -annex True 22 | 23 | copy mqttconf.swagger.docx core.generated.docx 24 | del -f *.swagger.docx 25 | 26 | :end 27 | --------------------------------------------------------------------------------