Manual Chapter :
OpenAPI
Applies To:
Show Versions
BIG-IP ASM
- 16.0.0
OpenAPI
The OpenAPI specification is an API description format for REST APIs. An OpenAPI file describes the entire API. The API specifications are written in either JSON or YAML.
The declarative policy can protect the API and enforce each request according to the openAPI definition.
The
open-api-files
array item is a used with either link
or filename
attribute to retract the OpenAPI file. The URL is either HTTPS or HTTP and the file path is either local directory or mounted file system, for example, file://apps/api/app4.json
.In following example, the OpenAPI file is retracted using
filename
attribute:"open-api-files": [ { "filename": "file://myapp.yaml" } ]
In following example, the OpenAPI file is retracted using
link
attribute:"open-api-files": [ { "link": "https://myserver.com/apis/myapp.yaml" } ]
In following example, the
openApiFileReference
property is used with link
attribute:"openApiFileReference":{ "link":"https://myserver.com/apis/myapp.yaml" }
Only the first item in a single array is processed. If there are more items in one
open-api-files
array or more than one array, or both open-api-files
array and openApiFileReference
parameter are available, the policy is rejected and not created on the device.The policy is built in the following order, the order implies that each layer overrides setting of its predecessors:
- TemplateIt is recommended to use the API Protection template, but any template can be used.
- OpenAPI fileIt is processed regardless of its physical placement within the file.
- JSON adjustment elementsOther JSON elements excluding the openAPI file.
- ModificationsThe modifications in the modification section.
For example, if the maximum length of a parameter
p1
is 5 in the template, 15 resulting from the OpenAPI file,10 in the JSON adjustments, and 20 in a specific modification, then the final policy will have the value of 20 from the modification. If there is no modification, the value would be 10 from the JSON adjustment.