Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Deutsch
Info

Die LMC-API verwendet Swagger/OpenAPI zur Spezifikation/Dokumentation der API-Schnittstelle.

Die Swagger index.json ist hier zu finden: https://cloud.lancom.de/<micro-service>/api-docs/index.json

Swagger wird auf der Webseite https://de.wikipedia.org/wiki/Swagger_(Software) wie folgt beschrieben:

Swagger ist eine Schnittstellenbeschreibungssprache zur Beschreibung von RESTful APIs, die mit JSON ausgedrückt werden. Swagger wird zusammen mit einer Reihe von Open-Source-Software-Tools verwendet, um RESTful-Webdienste zu entwerfen, zu erstellen, zu dokumentieren und zu verwenden. Swagger umfasst automatische Dokumentation, Codegenerierung (in vielen Programmiersprachen) und Testfallgenerierung.

Die vollständige Dokumentation finden Sie hier: https://swagger.io/docs/

Das vorherige json-Beispiel ist in Swagger JSON wie folgt spezifiziert:

{
    "DeviceResult": {
        "type": "object",
        "required": [
            "id"
        ],
        "properties": {
            "id": {
                "$ref": "#/definitions/UUID"
            },
            "siteName": {
                "type": "string"
            },
            "siteId": {
                "$ref": "#/definitions/UUID"
            },
            "location": {
                "type": "object",
                "properties": {
                    "latitude": {
                        "type": "number",
                        "format": "float"
                    },
                    "longitude": {
                        "type": "number",
                        "format": "float"
                    },
                    "description": {
                        "type": "string"
                    }
                }
            },
            "customFields": {
                "description": "Custom fields.",
                "type": "array",
                "items": {
                    // ...
                }
            },
            "status": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "device name"
                    },
                    "serial": {
                        "type": "string",
                        "description": "device serial number"
                    },
                    "mac": {
                        "type": "string",
                        "description": "device mac address"
                    },
                    "ip": {
                        "type": "string",
                        "description": "device ip address"
                    },
                    "model": {
                        "type": "string",
                        "description": "device model"
                    },
                    "heartbeatState": {
                        "type": "string",
                        "enum": [
                            "ACTIVE",
                            "INACTIVE",
                            "REDIRECTED",
                            "UNKNOWN",
                            "SHADOW"
                        ]
                    }
                }
            }
        }
    }
}
Englisch
Info

The LMC API uses Swagger/OpenAPI to specify/document the API interface.

The Swagger index.json is found here: https://cloud.lancom.de/<micro-service>/api-docs/index.json

Swagger is introduced on https://en.wikipedia.org/wiki/Swagger_(software) as follows:

Swagger is an Interface Description Language for describing RESTful APIs expressed using JSON. Swagger is used together with a set of open-source software tools to design, build, document, and use RESTful web services. Swagger includes automated documentation, code generation (into many programming languages), and test-case generation.

You can find the complete documentation here: https://swagger.io/docs/

The previous json example is specified in Swagger JSON as follows:

{
    "DeviceResult": {
        "type": "object",
        "required": [
            "id"
        ],
        "properties": {
            "id": {
                "$ref": "#/definitions/UUID"
            },
            "siteName": {
                "type": "string"
            },
            "siteId": {
                "$ref": "#/definitions/UUID"
            },
            "location": {
                "type": "object",
                "properties": {
                    "latitude": {
                        "type": "number",
                        "format": "float"
                    },
                    "longitude": {
                        "type": "number",
                        "format": "float"
                    },
                    "description": {
                        "type": "string"
                    }
                }
            },
            "customFields": {
                "description": "Custom fields.",
                "type": "array",
                "items": {
                    // ...
                }
            },
            "status": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "device name"
                    },
                    "serial": {
                        "type": "string",
                        "description": "device serial number"
                    },
                    "mac": {
                        "type": "string",
                        "description": "device mac address"
                    },
                    "ip": {
                        "type": "string",
                        "description": "device ip address"
                    },
                    "model": {
                        "type": "string",
                        "description": "device model"
                    },
                    "heartbeatState": {
                        "type": "string",
                        "enum": [
                            "ACTIVE",
                            "INACTIVE",
                            "REDIRECTED",
                            "UNKNOWN",
                            "SHADOW"
                        ]
                    }
                }
            }
        }
    }
}