Skip to content
entities-spec.json 6.85 KiB
Newer Older
canterafonsj's avatar
canterafonsj committed
  "openapi": "3.0.1",
  "info": {
canterafonsj's avatar
canterafonsj committed
    "title": "NGSI-LD Entities",
    "version": "latest"
canterafonsj's avatar
canterafonsj committed
  },
canterafonsj's avatar
canterafonsj committed
  "components": {
    "parameters": {
      "id": {
        "name": "id",
        "description": "Comma separated list of URIs to be retrieved",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uri"
        }
      },
      "type": {
        "name": "type",
        "description": "Comma separated list of Entity type names to be retrieved",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "idPattern": {
        "name": "idPattern",
        "description": "Regular expression that must be matched by Entity ids",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "regexp"
        }
      },
      "attrs": {
        "name": "attrs",
        "description": "Comma separated list of attribute names (properties or relationships) to be retrieved",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "q": {
        "name": "q",
        "description": "Query",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "georel": {
        "name": "georel",
        "description": "Geo-relationship",
        "in": "query",
        "required": false,
        "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
          "$ref": "http://localhost:8090/schema/common.json#/definitions/georel"
canterafonsj's avatar
canterafonsj committed
        }
      },
      "geometry": {
        "name": "geometry",
        "description": "Geometry",
        "in": "query",
        "required": false,
        "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
          "$ref": "http://localhost:8090/schema/common.json#/definitions/geometry"
canterafonsj's avatar
canterafonsj committed
        }
      },
      "coordinates": {
        "name": "coordinates",
        "description": "Coordinates serialized as a string",
        "in": "query",
        "required": false,
        "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
          "$ref": "http://localhost:8090/schema/common.json#/definitions/coordinates"
canterafonsj's avatar
canterafonsj committed
        }
      },
      "geoproperty": {
        "name": "geoproperty",
        "description": "The name of the property that contains the geo-spatial data that will be used to resolve the geoquery",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "csf": {
        "name": "csf",
        "description": "Context Source Filter",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "limit": {
        "name": "limit",
        "description": "Pagination limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "options":{
        "name": "options",
        "description": "Options dictionary",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": ["keyValues", "sysAttrs"]
canterafonsj's avatar
canterafonsj committed
      }
canterafonsj's avatar
canterafonsj committed
    }
  },
  "paths": {
    "/entities/": {
      "get": {
        "description": "Retrieve a set of entities which matches a specific query from an NGSI-LD system",
        "operationId": "queryEntities",
Stefan Wiedemann's avatar
Stefan Wiedemann committed
        "tags": ["Context Information", "Entities"],
canterafonsj's avatar
canterafonsj committed
        "parameters": [
          {
canterafonsj's avatar
canterafonsj committed
            "$ref": "#/components/parameters/id"
          },
          {
            "$ref": "#/components/parameters/idPattern"
          },
          {
            "$ref": "#/components/parameters/type"
          },
          {
            "$ref": "#/components/parameters/attrs"
          },
          {
            "$ref": "#/components/parameters/q"
          },
          {
            "$ref": "#/components/parameters/georel"
          },
          {
            "$ref": "#/components/parameters/geometry"
          },
          {
            "$ref": "#/components/parameters/coordinates"
          },
          {
            "$ref": "#/components/parameters/geoproperty"
          },
          {
            "$ref": "#/components/parameters/csf"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/options"
canterafonsj's avatar
canterafonsj committed
          }
        ],
        "responses": {
          "200": {
canterafonsj's avatar
canterafonsj committed
            "description": "OK",
canterafonsj's avatar
canterafonsj committed
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  "$ref": "http://localhost:8090/schema/EntityList.json#/definitions/EntityList"
canterafonsj's avatar
canterafonsj committed
                },
                "examples": {
                  "simple": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                    "externalValue": "http://localhost:8090/examples/EntityList-example.json"
canterafonsj's avatar
canterafonsj committed
                  }
canterafonsj's avatar
canterafonsj committed
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
      },
canterafonsj's avatar
canterafonsj committed
      "post": {
canterafonsj's avatar
canterafonsj committed
        "description": "Create a new Entity within an NGSI-LD system",
        "operationId": "createEntity",
Stefan Wiedemann's avatar
Stefan Wiedemann committed
        "tags": ["Context Information", "Entities"],
canterafonsj's avatar
canterafonsj committed
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                "$ref": "http://localhost:8090/schema/Entity.json#/definitions/Entity"
canterafonsj's avatar
canterafonsj committed
              }
            }
          }
        },
        "responses": {
canterafonsj's avatar
canterafonsj committed
          "201": {
            "description": "Created. Contains the resource URI of the created Entity"
canterafonsj's avatar
canterafonsj committed
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
                }
              }
            }
canterafonsj's avatar
canterafonsj committed
          },
          "409": {
            "description": "Already exists",
canterafonsj's avatar
canterafonsj committed
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
          "422": {
            "description": "Unprocessable Entity",
canterafonsj's avatar
canterafonsj committed
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"