Validating the OpenAPI YAML source
How to validate the OpenAPI YAML source against swagger specifications when you're editing an API.
About this task
When you're configuring an API in the API editor, you can validate the OpenAPI YAML source by
clicking . If any swagger parser validation errors are found, an
error icon is displayed that you can then click to see the individual errors, and where they occur
in the YAML. You can then fix the errors, save the updates, and continue to validate the OpenAPI YAML throughout the
API configuration process.
Note:
- OpenAPI validation does not show gateway or policy errors that will stop your API from being staged or published. This type of validation occurs only when you try to stage or publish your API. For more information, see Staging an API or Publishing an API.
- You can also validate your API document by using governance rulesets. For more information, see Validating an API or product document by using the governance service.
You can complete this task either by using the API Designer UI application, or by using the browser-based API Manager UI.
Procedure
To validate the OpenAPI YAML source, complete the following steps.
- Open the required API for editing, as described in Editing an OpenAPI 2.0 API definition or Editing an OpenAPI 3.0 API definition.
- Click from the menu bar in the header.
- If any swagger parser validation errors are found, an error icon is displayed on the
header menu bar, with the number of OpenAPI errors found displayed
next to the icon. For example, .
- You can then click the error icon to see a detailed list of the errors, and their location in the YAML. If you're in Form view, you can click an individual error to navigate directly to the relevant API section in the form.
- After you fix the error, click Save to save your updates, and then click Validate again.
- When all of the errors are fixed, the validation returns a success message.
For example, .