OpenAPI

Open API Specification

Definition

OpenAPI (formerly Swagger) is an open specification describing RESTful APIs, defining interface paths, parameters, response formats, and more. The Device Management Platform provides OpenAPI documentation, facilitating third-party systems in integrating device management, data queries, OTA capabilities, etc., and is used alongside RESTful APIs.

Specification Content and Toolchain

OpenAPI 3.x uses YAML/JSON to describe API paths, methods, request/response schemas, authentication methods, and more. Based on the specification, interactive documentation (Swagger UI), client SDKs, server stub code, and mock services can be automatically generated. The Device Management Platform typically provides OpenAPI definitions for interfaces such as device CRUD, product management, OTA tasks, alarm subscriptions, and data queries; it supports version management (e.g., /v1, /v2), facilitating API evolution and compatibility.

Integration with DMP

The platform lowers the integration threshold through OpenAPI documentation. Third parties can understand the interfaces, generate code, and perform joint debugging through the documentation. Combined with capabilities such as Webhook callbacks and Event Stream event streams, a complete integration ecosystem can be built. Documentation can be hosted on the platform or exported for offline use; it supports Try it out for online debugging, enhancing the developer experience. The API gateway can perform request validation, rate limiting, and monitoring based on OpenAPI.

Use Cases

Suitable for system integration, automated operations and maintenance, third-party application development, BI tool integration, etc. OpenAPI is the standard carrier of the Device Management Platform's open capabilities, helping to build a partner ecosystem and accelerate business integration.

The interface description and the runtime gateway

OpenAPI is a structured description of an interface: which paths exist, which method to use, what shape the parameters and the body have, what is returned on success and on failure, and how the caller proves identity. People and tools read that description to generate documentation, clients, and mock services. It is not itself a gateway, and it does not automatically reject a request that disagrees with the document at runtime, unless a gateway or a service is configured to validate against it. A complete document only means the intention was written down. Whether production follows it depends on the implementation and on validation. The version should be written in the description and in the path. A change in the behavior of an old version cannot be only a change of words with the version left the same. Device-management operations, such as querying one device, creating an upgrade task, or subscribing to alarms, should say in the description where the identifier comes from, which fields are read-only, and how paging continues. Examples should use obvious placeholders. A real key does not belong in the repository. If the parameters for creating an over-the-air update task are optional in the description and required in the service, the integrator finds that out only during joint debugging. If a telemetry query does not state an upper bound on the time range, a caller may pull more data in one request than the interface was designed for.

When the document can stand as a contract

For the description to stand as a contract, it has to correspond one-to-one with the version currently deployed, and it has to be updated by the same change process: when the interface changes, the description changes with it, and the old description can still be retrieved. Authentication, error codes, idempotency, and rate limits are part of the contract. Paths and a success example alone are not enough. A change that breaks compatibility should enter a new version, not change the meaning of a field on the original path. If a generated client is committed into a business system, record which revision of the description it corresponds to, so the description is not upgraded while the client still parses the old fields. The account used for a try-it function should have small permissions and should be isolated from production data. A description published to a partner should have internal fields removed. If the server validates input against the description, the validation rules have to be released together with the document. The document must not list an enumeration while the service accepts any string, or the reverse. When several teams maintain it, someone has to own the merge of this description, so parallel branches do not each invent their own paths.

When the document version and the live path diverge

A description stuck on the first revision, while production has already added a required parameter, gives the caller a vague failure if they follow the document. The same path is one resource in the description and is rewritten by the gateway to another service in production, and the field names do not match. Error codes maintained only on an internal wiki, with every failure in the document written as one generic object, leave the caller unable to branch. A security scheme written in the document as one kind of token, already changed to another kind in production, can still "try successfully" because the try-it environment was not updated. Hand-editing the description file without validation, with bad indentation or a bad reference, generates a client that is missing half the operations. A version number written only in the file name, while the server address in the body still points at the old environment, misleads the caller. A deprecated path that is not marked in the description is still used by new integrations that are about to be shut off. When the document repository and the runtime configuration belong to two people, and the day of release forgets to update them together, the joint-debugging conclusion becomes "the platform is unstable," when the contract was simply not released together.

Related Terms

Return to Device Management Platform terminology