+
+

Finding API Conformance Issues in API Definitions

Apply governance rulesets to API definitions as you author them, either in Design Center using API Designer or by using the governance CLI. You can also validate governance rulesets to make sure they are formatted correctly using the governance CLI.

Validate API Definitions in Design Center

To validate APIs against governance rulesets, add the rulesets as dependencies to API specifications in Design Center API Designer. After you add the rulesets, expand the Project Errors section to view conformance messages.

Screenshot of rulesets applied as dependencies in API Designer
1 Add rulesets to your API project.
2 View conformance issues and filter by level of severity.
3 Expand the Project Errors section of the text editor to view nonconformance messages.

Validate API Definitions Against Governance Rulesets Using the API Governance CLI

If you want to use a command to validate your API definition against governance rulesets, use the governance api validate command.

Limitations

This command does not validate the dependencies of the API definition, such as fragments.

governance api validate

> governance api validate <governance-ruleset> <api-definition-zip-file>

This command validates an API definition against a specified ruleset.

Example command:

anypoint-cli governance api validate ~/Downloads/ruleset.yaml ~/Downloads/order-api-1.0.0-raml.zip

Example output:

For a specification that is conformant to the ruleset:

 Spec conforms with Ruleset

For a specification that is nonconformant to the ruleset:

 Ruleset /path/Downloads/ruleset.yaml
 Spec /path/Downloads/order-api-1.0.0-raml.zip
 Spec does not conform with Ruleset
 [.. full report shown here..]

Was this article helpful?

💙 Thanks for your feedback!

Submit your feedback!
Share your thoughts to help us build the best documentation experience for you!
Take our latest survey!