Các tham chiếu #/components/schemas/... trong request và response được định nghĩa dưới đây.
schemas
{
"Error": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
},
"required": [
"error"
]
},
"StatusInput": {
"description": "Accepted normalized status values. Strings are case-sensitive and are not trimmed.",
"oneOf": [
{
"type": "boolean"
},
{
"type": "integer",
"enum": [
0,
1
]
},
{
"type": "string",
"enum": [
"true",
"false",
"1",
"0"
]
}
]
},
"Face": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"provider": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"username": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"sha256_background": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"created_at": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 253402300799,
"description": "Unix seconds, not milliseconds."
},
"used": {
"type": "boolean"
},
"link_download": {
"type": "string",
"minLength": 1,
"maxLength": 4096,
"description": "HTTP or HTTPS download URL; server does not fetch or check availability."
},
"count_found": {
"type": "integer",
"minimum": 0,
"description": "Number of times selected by GET /api/faces. Existence/detail checks do not increment it."
}
},
"required": [
"id",
"provider",
"username",
"sha256_background",
"created_at",
"used",
"link_download",
"count_found"
]
},
"FaceCreate": {
"type": "object",
"properties": {
"provider": {
"type": "string",
"minLength": 1,
"description": "Trimmed by the server; trimmed length must be 1-255."
},
"username": {
"type": "string",
"minLength": 1,
"description": "Trimmed by the server; trimmed length must be 1-255."
},
"sha256_background": {
"type": "string",
"description": "Trimmed, then must contain exactly 64 hexadecimal characters. Normalized to lowercase."
},
"created_at": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 253402300799,
"description": "Unix seconds. Omit to use server time; explicit null is preserved."
},
"used": {
"$ref": "#/components/schemas/StatusInput"
},
"used_status": {
"$ref": "#/components/schemas/StatusInput"
},
"link_download": {
"type": "string",
"description": "Trimmed, length 1-4096; parsed URL must have protocol http: or https:."
}
},
"required": [
"provider",
"username",
"sha256_background",
"link_download"
],
"additionalProperties": false,
"example": {
"provider": "example",
"username": "leson",
"sha256_background": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"link_download": "https://example.com/face.jpg",
"used": false
}
},
"FacePage": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Face"
},
"maxItems": 5
},
"limit": {
"type": "integer",
"const": 5
},
"next_cursor": {
"type": "null",
"description": "Always null: random samples have no next page."
}
},
"required": [
"data",
"limit",
"next_cursor"
]
},
"Statistics": {
"type": "object",
"properties": {
"summary": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"minimum": 0
},
"used": {
"type": "integer",
"minimum": 0
},
"unused": {
"type": "integer",
"minimum": 0
},
"providers": {
"type": "integer",
"minimum": 0
},
"added_today": {
"type": "integer",
"minimum": 0
}
},
"required": [
"total",
"used",
"unused",
"providers",
"added_today"
]
},
"providers": {
"type": "array",
"maxItems": 8,
"items": {
"type": "object",
"properties": {
"provider": {
"type": "string"
},
"total": {
"type": "integer",
"minimum": 0
},
"used": {
"type": "integer",
"minimum": 0
},
"unused": {
"type": "integer",
"minimum": 0
}
},
"required": [
"provider",
"total",
"used",
"unused"
]
}
},
"daily": {
"type": "array",
"minItems": 7,
"maxItems": 7,
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date"
},
"total": {
"type": "integer",
"minimum": 0
}
},
"required": [
"date",
"total"
]
}
},
"timezone": {
"type": "string",
"const": "UTC"
}
},
"required": [
"summary",
"providers",
"daily",
"timezone"
]
},
"Item": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"description": {
"type": "string",
"maxLength": 5000
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"name",
"description",
"created_at",
"updated_at"
]
},
"ItemInput": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Trimmed by the server; trimmed length must be 1-200."
},
"description": {
"type": "string",
"maxLength": 5000,
"default": ""
}
},
"required": [
"name"
],
"additionalProperties": true,
"description": "Extra fields are ignored. Description is not trimmed."
},
"FaceExists": {
"oneOf": [
{
"type": "object",
"properties": {
"exists": {
"const": true
},
"data": {
"$ref": "#/components/schemas/Face"
}
},
"required": [
"exists",
"data"
]
},
{
"type": "object",
"properties": {
"exists": {
"const": false
},
"data": {
"type": "null"
}
},
"required": [
"exists",
"data"
]
}
]
},
"ManagedFacePage": {
"type": "object",
"required": [
"data",
"total",
"limit",
"offset"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Face"
}
},
"total": {
"type": "integer",
"minimum": 0
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"offset": {
"type": "integer",
"minimum": 0
}
}
}
}