Commit 530e7042 authored by Stefan Wiedemann's avatar Stefan Wiedemann
Browse files

update api

add tools for local dev
parent b4d17d35
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -14,6 +14,24 @@ More info @ [CONTIBUTE](./CONTRIBUTE.md)

Change requests are managed using [Gerrit](https://forge.etsi.org/gerrit).

### Local editing
>:warning: The described setup requires [docker](https://docs.docker.com/engine/install/) to be installed.

In order to edit the api locally, the script [runLocalDevEnv.sh](scripts/runLocalDevEnv.sh) can be used. When executed from the root of this repository,
it replaces all paths to the master branch inside [spec](spec) and [schema](schema) and serves them through a local file-server. Without that, all 
references are resolved with 'https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master' and therefore changes will not be present locally.

With the local file-server still running, you can build the bundled api via:
```
docker run --network host -it -v ${PWD}/:/data broothie/redoc-cli bundle spec/updated/ngsi-ld-spec-open-api.json -o spec/updated/full_api.json
```
And validate it with:
```
docker run --network host --rm -v ${PWD}/:/local openapitools/openapi-generator-cli validate -i /local/spec/updated/full_api.json
```

When editing is finished, hit the enter button on your local dev env and push.

## Report issues

To report issues, bugs or requests please fill in a bug [at this location](https://forge.etsi.org/bugzilla/enter_bug.cgi?product=NGSI-LD).
+10 −9
Original line number Diff line number Diff line
{
  "$schema": "http://json-schema.org/schema#",
  "$id": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/BatchOperationResult.json",
  "title": "NGSI-LD Batch Operation Result",
  "description": "NGSI-LD Batch Operation Result",
  "definitions": {
    "BatchEntityError": {
      "type": "object",
      "properties": {
        "entityId": {
          "type": "string",
          "format": "uri"
@@ -12,6 +12,7 @@
        "error": {
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails"
        }
      }
    },
    "BatchOperationResult": {
      "type": "object",
+9 −14
Original line number Diff line number Diff line
{
  "$schema": "http://json-schema.org/schema#",
  "$id": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json",
  "title": "NGSI-LD Entity",
  "description": "NGSI-LD Entity",
  "definitions": {
@@ -17,10 +15,10 @@
      "properties": {
        "type": {
          "type": "string",
          "const": "Property"
          "enum": ["Property"]
        },
        "value": {
          "type": [
          "oneOf": [
            "string",
            "number",
            "boolean",
@@ -49,7 +47,7 @@
        "value"
      ],
      "additionalProperties": {
        "anyOf": [
        "oneOf": [
          {
            "$ref": "#/definitions/Property"
          },
@@ -64,7 +62,7 @@
      "properties": {
        "type": {
          "type": "string",
          "const": "Relationship"
          "enum": ["Relationship"]
        },
        "object": {
          "type": "string",
@@ -91,7 +89,7 @@
        "object"
      ],
      "additionalProperties": {
        "anyOf": [
        "oneOf": [
          {
            "$ref": "#/definitions/Property"
          },
@@ -106,10 +104,10 @@
      "properties": {
        "type": {
          "type": "string",
          "const": "GeoProperty"
          "enum":  ["GeoProperty"]
        },
        "value": {
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/Geometry.json#/definitions/Geometry"
        },
        "observedAt": {
          "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt"
@@ -132,7 +130,7 @@
        "value"
      ],
      "additionalProperties": {
        "anyOf": [
        "oneOf": [
          {
            "$ref": "#/definitions/Property"
          },
@@ -172,7 +170,7 @@
        }
      },
      "additionalProperties": {
        "anyOf": [
        "oneOf": [
          {
            "$ref": "#/definitions/Property"
          },
@@ -183,9 +181,6 @@
            "$ref": "#/definitions/GeoProperty"
          }
        ]
      },
      "propertyNames": {
        "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/PropertyNames"
      }
    },
    "Entity": {
+6 −6
Original line number Diff line number Diff line
{
  "$schema": "http://json-schema.org/schema#",
  "$id": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/EntityList.json",
  "title": "NGSI-LD EntityList",
  "description": "NGSI-LD EntityList",
  "definitions": {
@@ -11,7 +9,9 @@
      }
    }
  },
  "allOf": [{
  "allOf": [
    {
      "$ref": "#/definitions/EntityList"
  }]
    }
  ]
}
 No newline at end of file

schema/Entity_keyValues.json

deleted100644 → 0
+0 −50
Original line number Diff line number Diff line
{
  "$schema": "http://json-schema.org/schema#",
  "$id": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/Entity_keyValues.json",
  "title": "NGSI-LD Entity Key Values",
  "description": "NGSI-LD Entity Simplified Representation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uri"
    },
    "type": {
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
    },
    "@context": {
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
    },
    "location": {
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
    },
    "observationSpace": {
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
    },
    "operationSpace": {
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
    },
    "createdAt": {
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
    },
    "modifiedAt": {
      "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
    }
  },
  "required": [
    "type",
    "id"
  ],
  "additionalProperties": {
    "type": [
      "string",
      "number",
      "boolean",
      "array",
      "object"
    ]
  },
  "propertyNames": {
    "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/PropertyNames"
  }
}
Loading