-
Notifications
You must be signed in to change notification settings - Fork 3
Syntax
- METHOD /PATH or ALIAS:
- Definition: Endpoint entry, mandatory and unique.
- When found duplicated entries, only the first occurrence will be processed.
YAML:
GET /path/yaml:
...
Endpoint YAML:
...
JSON:
{
"POST /path/json" : {
...
},
"Endpoint JSON" : {
...
}
}
-
method: (Required)
Defines endpoint method, will override previous definitions.
Supported HTTP Methods:- GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE
YAML: method: GET JSON: "method": "POST"
-
path: (Required)
Defines endpoint path, will override previous definitions.
Proper syntax= prefixed with "/".YAML: path: /path/to/your/test JSON: "path": "/my/lyre/endpoint"
-
alias | name: (Optional)
Endpoint identification.
Default value:- method and path
YAML: alias: Endpoint A name: Endpoint B JSON: "alias": "Endpoint C" "name": "Endpoint D"
-
consumes: (Optional)
Defines consumed media Type.
Default value:- */ *
YAML: consumes: application/xml JSON: "consumes": "application/json"
-
data: (Optional)
Defines the expected data.
Data need to match with the request data to accept.YAML: consumes: '{"data":"123"}' JSON: "consumes": "{'data':'123'}"
-
response | responses: (Required)
- Definition: Endpoint response.
YAML: response: ... responses: ... JSON: { "response" : { ... }, "responses" : { ... } }
-
property | properties: (Optional)
- Definition: Endpoint properties.
YAML: property: ... properties: ... JSON: { "property" : { ... }, "properties" : { ... } }
-
idle | timeout: (Optional)
Idle property allows to set delay (milliseconds) at endpoint response.
YAML: idle: 1000 timeout: 1500 JSON: "idle": 2000 "timeout": 2500
// TODO header: custom_key: response(s): 200: header: custom_key: produces: data: 'as string'
GET /api/v{version}/search?data=1&q=2: data: method: consumes: idle: in milisseconds (timeout) response: status: header: varN: produces: data: $enpoint.response setup: busy: returns http 429 (number of busy calls) forbidden: return http 403 (forbidden) (number of busy calls) broken: return http 500 (number of busy calls) custom: status: calls: