CMHopeSunshine/nonebot-adapter-villa

Bug: validation errors for Image

Closed this issue · 1 comments

mobyw commented

Python 版本

Any

版本

1.3.0

描述问题

Image 对象的 size 字段中 heightwidth 非可选字段,可能无法通过验证

"image": Image.parse_obj(
{
"url": url,
"size": {
"width": width,
"height": height,
},
"file_size": file_size,
},
),

class ImageSize(BaseModel):
width: int
height: int
class Image(BaseModel):
url: str
size: Optional[ImageSize] = None
file_size: Optional[int] = None

复现步骤

MessageSegment.image(url="https://www.miyoushe.com/_nuxt/img/miHoYo_Game.2457753.png")

期望的结果

Verification passed

截图或日志

No response