mirror of
https://github.com/discourse/discourse.git
synced 2024-12-23 10:26:17 +08:00
16acba6cf8
Since we recently blocked accidental serialization of AR models, we are getting a 500 error in some cases with thumbnails. We can fix this by serializing the thumbnail, previously we just returned a raw OptimizedImage object. Thumbnails are now attached to the serializer in core, therefore we no longer need to use add_to_serializer within the chat plugin to use thumbnails within chat message uploads.
90 lines
1.5 KiB
JSON
90 lines
1.5 KiB
JSON
{
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"original_filename": {
|
|
"type": "string"
|
|
},
|
|
"filesize": {
|
|
"type": "integer"
|
|
},
|
|
"width": {
|
|
"type": "integer"
|
|
},
|
|
"height": {
|
|
"type": "integer"
|
|
},
|
|
"thumbnail_width": {
|
|
"type": "integer"
|
|
},
|
|
"thumbnail_height": {
|
|
"type": "integer"
|
|
},
|
|
"extension": {
|
|
"type": "string"
|
|
},
|
|
"short_url": {
|
|
"type": "string"
|
|
},
|
|
"short_path": {
|
|
"type": "string"
|
|
},
|
|
"retain_hours": {
|
|
"type": ["string", "null"]
|
|
},
|
|
"human_filesize": {
|
|
"type": "string"
|
|
},
|
|
"dominant_color": {
|
|
"type": ["string", "null"]
|
|
},
|
|
"thumbnail": {
|
|
"type": ["object", "null"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"upload_id": {
|
|
"type": "integer"
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"extension": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "integer"
|
|
},
|
|
"height": {
|
|
"type": "integer"
|
|
},
|
|
"filesize": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"url",
|
|
"original_filename",
|
|
"filesize",
|
|
"width",
|
|
"height",
|
|
"thumbnail_width",
|
|
"thumbnail_height",
|
|
"extension",
|
|
"short_url",
|
|
"short_path",
|
|
"retain_hours",
|
|
"human_filesize"
|
|
]
|
|
}
|