Get schema by resource name
GET /apisix/admin/schema/{resource_name}
GET /apisix/admin/schema/{resource_name}Interactive request editor loads with JavaScript.
X-API-KEY<token>
In: header
Path Parameters
resource_name*string
Name of the resource.
Length
1 <= lengthValue in
- "service"
- "upstream"
- "stream_service"
- "stream_upstream"
- "route"
- "consumer"
- "consumer_credential"
- "global_rule"
- "ssl"
- "vault_secret"
- "aws_secret"
- "kubernetes_secret"
- "plugin_metadata"
- "stream_route"
Response Body
application/json
application/json
application/json
curl -X GET "$API_BASE_URL/apisix/admin/schema/consumer"Successfully retrieved the schema for the specified core 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"
}Not found
{
"value": {},
"error_msg": "not found schema: license"
}Complete operation details and schema variants
GET /apisix/admin/schema/{resource_name}
Get schema by resource name
Get the schema definition for a specific resource type by name. This is useful when rendering dynamic forms or validating resource-specific request payloads.
Parameters
resource_name(path, string, required): Name of the resource.
Responses
200: Successfully retrieved the schema for the specified core 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.404: Not found Response fields (application/json): identical toGET /apisix/admin/schema/{resource_name}, response 400 above.
cURL
curl -X GET '$API_BASE_URL/apisix/admin/schema/{resource_name}'