Tanzu Service Mesh automatically scans an API specification to validate it for problems and generates API scores based on the scans. The scores indicate the quality and coverage of the API documentation, compliance with the OpenAPI standards, health, and security of the API specification. You can view the API scores and recommendations for any problems found.
Based on the feedback and recommendations, you can edit your API specification, improve the design and security posture of your API, and thus improve the API scores.
After scanning an API specification, Tanzu Service Mesh generates the following scores:
Documentation Health score
OpenAPI Health score
Security score
Governance score
The Documentation Health validation evaluates and validates the API specification for documentation quality and coverage and generates a Documentation Health score. The API documentation is evaluated against three areas:
Documentation of operations. The validation checks whether the paths and operations in the API specification are properly described.
Documentation of domains. The validation checks whether the domains (tags) are properly described.
Documentation of data structures. The validation checks whether the objects in the
components
object in the specification are properly described.
Tanzu Service Mesh evaluates these documentation areas and and generates a health score for each. The individual area scores are then considered to generate an aggregate Documentation Health score.
The OpenAPI Health validation evaluates the API specification for compliance with OpenAPI standards by using a built-in set of linting and schema validation rules. For example, the OpenAPI Health validation checks the specification for things like use of valid HTTP verbs and use of lower snake case (lower_snake_case) in query parameter names. To calculate an OpenAPI Heatlh score, Tanzu Service Mesh considers the following:
Total number of rules
Number of occurrences of each violated rule
Number of entities (for example, API paths or operations) where a violation occurred
Health scores of individual rules
The Security validation scans the API specification for security problems by using a built-in set of static security rules. For example, the Security validation checks the specification for things like use of only secure connections in the servers
object and presence of an API key in the security scheme. To calculate a Security score, Tanzu Service Mesh considers the following:
Total number of rules
Number of occurrences of each violated rule
Number of entities (for example, API paths or operations) where a violation occurred
Health scores of individual rules
The Governance score helps you understand if the API has any breaking changes. The Governance validation checks the API specification for breaking changes by comparing the latest version of the specification in the primary branch in the GitHub repository against an earlier version that was created internally in Tanzu Service Mesh. If any breaking changes are detected (for example, an endpoint was deleted) as a result of the comparison, Tanzu Service Mesh displays a warning at the top of the API details page. You can click the link in the warning to view what caused the breaking changes.
To calculate a Governance score, Tanzu Service Mesh considers the following:
Total number of changes in the API specification
Number of breaking changes
What factors are considered in calculation
Number of nonbreaking changes
The weight of breaking and nonbreaking changes
Currently, breaking and nonbreaking changes have the same weight.
Perform the following procedure to view the API scores and details about the problems with the specification, including breaking changes.
Prerequisites
API validation and scoring is available only for configured APIs. Verify that you are familiar with the concept of a configured API. For information about configured APIs, see Configured APIs.
Verify that you are familiar with OpenAPI Specification concepts such as paths, operations, and tags.