Get OpenAPI schema
GET /api/openapi/request_body_schema
GET /api/openapi/request_body_schemaInteractive request editor loads with JavaScript.
X-API-KEY<token>
In: header
Query Parameters
method*string
HTTP method to determine which request body to return.
Length
1 <= lengthValue in
- "POST"
- "PUT"
path*string
API endpoint.
Length
1 <= lengthResponse Body
application/json
application/json
curl -X GET "$API_BASE_URL/api/openapi/request_body_schema?method=POST&path=%2Fapisix%2Fadmin%2Fconsumers"Successfully retrieved the request body schema for the specified resource.
{
"value": {},
"description": "The consumer description.",
"properties": {
"desc": {
"description": "The object description.",
"maxLength": 65536,
"type": "string"
},
"labels": {
"additionalProperties": {
"maxLength": 65536,
"minLength": 1,
"pattern": "^.+$",
"type": "string"
},
"example": {
"keyA": "valueA",
"keyB": "valueB"
},
"type": "object"
},
"plugins": {
"description": "The key-value pairs which represent the plugins attached on the object.",
"type": "object"
},
"username": {
"maxLength": 512,
"minLength": 1,
"pattern": "^[a-zA-Z0-9_\\-]+$",
"type": "string"
}
},
"required": [
"username"
],
"type": "object"
}Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
{
"value": {},
"error_msg": "error message"
}Complete operation details and schema variants
GET /api/openapi/request_body_schema
Get OpenAPI schema
The endpoint returns the request body schema of PUT/POST requests for users to understand how to structure a request.
Parameters
method(query, string, required): HTTP method to determine which request body to return.path(query, string, required): API endpoint.
Responses
200: Successfully retrieved the request body schema for the specified resource.- allOf variant 1
value(object, optional): The specific resource.- allOf variant 2
400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.value(object, optional): The specific resource.error_msg(string, optional): The error message.
cURL
curl -X GET '$API_BASE_URL/api/openapi/request_body_schema'