u
This commit is contained in:
@@ -31,9 +31,205 @@
|
||||
{
|
||||
"name": "Company",
|
||||
"description": "Company CRUD"
|
||||
},
|
||||
{
|
||||
"name": "Image",
|
||||
"description": "Content-addressed AVIF by fullHash"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/image/{fullHash}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Image"
|
||||
],
|
||||
"summary": "Full image by hash",
|
||||
"description": "Returns the full AVIF by `pic.hash` (SHA-256 hex).\nAuth via article category access. Browser-cacheable (`private`, `immutable`, `ETag`).\n",
|
||||
"security": [
|
||||
{
|
||||
"cookieAuth": []
|
||||
}
|
||||
],
|
||||
"x-markdown": "image/get.md",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "fullHash",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-fA-F0-9]{64}$"
|
||||
},
|
||||
"description": "SHA-256 hex of the full image bytes"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "AVIF image bytes",
|
||||
"headers": {
|
||||
"Cache-Control": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"example": "private, max-age=31536000, immutable"
|
||||
}
|
||||
},
|
||||
"ETag": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"content": {
|
||||
"image/avif": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "binary"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"304": {
|
||||
"description": "Not modified (If-None-Match matched ETag)"
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid hash",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Not authorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Image not found",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/thumb/{fullHash}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Image"
|
||||
],
|
||||
"summary": "Thumb image by hash",
|
||||
"description": "Returns the thumb AVIF for `pic.hash` (fullHash — not thumbhash).\nAuth via article category access. Browser-cacheable (`private`, `immutable`, `ETag`).\n",
|
||||
"security": [
|
||||
{
|
||||
"cookieAuth": []
|
||||
}
|
||||
],
|
||||
"x-markdown": "thumb/get.md",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "fullHash",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-fA-F0-9]{64}$"
|
||||
},
|
||||
"description": "SHA-256 hex of the full image bytes"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "AVIF thumb bytes",
|
||||
"headers": {
|
||||
"Cache-Control": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"example": "private, max-age=31536000, immutable"
|
||||
}
|
||||
},
|
||||
"ETag": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"content": {
|
||||
"image/avif": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "binary"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"304": {
|
||||
"description": "Not modified (If-None-Match matched ETag)"
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid hash",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Not authorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Image not found",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/health": {
|
||||
"get": {
|
||||
"tags": [
|
||||
|
||||
Reference in New Issue
Block a user