Interface Completeness
Poor documentation is one of the most frequent problems faced by API consumers. For example, resources often have no description showing us what they’re for and request often fail without the return telling us what we should do to get the call through. Problems of this type can be avoided if there’s governance in place establishing that APIs can only de deployed in a production environment if their documentation is ok.
Sensedia developed the Interface Completeness feature precisely to help you visualise how complete an API’s documentation is.
There’s no specific page for Interface Completeness; it shows on the upper right corner of an API’s Overview screen:
The feature analyses the API’s Swagger and compares que amount of fields it has with the total amount of fields that could be included in a Swagger file. Based on this comparison, it shows a percentage to represent the file’s completeness degree. Also, based on the problems detected, it offers suggestions so you can improve the documentation (read more about it below).
With this, you can:
-
use the completeness percentage as a requirement to promove APIs from one workflow stage to another (see more about it below);
-
ensure that the API you’re exposing to the public on your Developer’s Portal is sufficiently documented (you can choose to exhibit APIs on the Developer’s Portal on the API’s Overview screen).
How can I interpret the Interface Completeness percentage? To get to the final percentage, we compare the quantity of fields your Swagger file has to the total quantity of fields that could be included. Using our expertise on APIs, we assign different weights to the fields, to value itens that are more important (for example, including HTTP return codes is more important than describing the error). We also validate the format of some fields, for example:
Anyway, the final result is quantitative not qualitative: it provides a measure of documentation completeness, it says nothing of the quality of the design. For example, we check whether your API has a description not if the description is well suited to what the API does or is clear to the consumer. You can and should use this percentage as a checkbox before exposing the API, ensuring that the Swagger has been worked on and is sufficiently complete, but not as a validation of the API’s quality. As to the percentage value that could work as a completeness threshold, this depends to your API strategy and the objectives of each API you design. That’s why you can define any value you want for Interface Completeness as a requirement to promote APIs from one workflow stage to another (see more about it below).
|
Suggestions to improve the Swagger file
The feature also displays improvement suggestions after it checks the Swagger file fields. To see them, click on Suggestions, below the percentage.
You can make modifications using the Swagger editor (see more information about it here).
After you make your changes and save your API as a new Revision, the completeness assessment is done again.
Fields checked
These are the fields that the feature checks to assess the level of completeness of an API’s documentation (note that there are different weights for each):
API | Resource/Operation | Model |
---|---|---|
|
|
|
How to use Interface Completeness with Workflows
The Workflows feature controls the stages of API development. On it, you can customise the requirements for an API to be promoted between the stages, which gives visibility and control of the development process of each API.
One of the requirements that can be set is a minimum percentage of Interface Completeness. In this case, if you define that only APIs with at least 85% of completeness must be in the "Production" stage and also include a requirement that only APIs in this stage can be deployed to a production environment, then you effectively establish that no APIs can be deployed to the public without satisfactory documentation!
You can read more about Workflows here.
Share your suggestions with us!
Click here and then [+ Submit idea]