Note1: Limitation: only read the first item when there are multiple servers
Note2: Limitation: servers element in path item or operation items are not implemented.
When OpenAPI doc specifies base path in the serverstop level object, all the operations are prefixed with the base path of the server object. For example:
What
OAS server path as base path for matchers
When OpenAPI doc specifies base path in the
servers
top level object, all the operations are prefixed with the base path of the server object. For example:For this example, all the paths will be prefixed with
/api/v1
base path. The second server object is omitted.Verification Steps
httproute-kuadrant-extensions
bin/kuadrantctl
pathGET /cat
GET /api/v1/cat
POST /cat
POST /api/v1/cat
GET /dog
GET /api/v1/dog
POST /dog
POST /api/v1/dog
GET /mouse
GET /api/v1/mouse
Create the HTTPRoute using the CLI
Create the Rate Limit Policy
Test OpenAPI endpoints
GET /api/v1/cat
-> It should return 200 Ok and be rate limited (1 req / 10 seconds)POST /api/v1/cat
-> Not added to the HTTPRoute. It should return 404 Not FoundGET /api/v1/dog
-> It should return 200 Ok and be rate limited (3 req / 10 seconds)POST /api/v1/dog
-> It should return 200 Ok and NOT rate limitedGET /api/v1/mouse
-> Not added to the HTTPRoute. It should return 404 Not Found