pydantic 字段字段校验
查询餐数据校验
async def fetch_dicom_metadata_slim(
hosp_code: Annotated[Union[str, None], Query(alias="hospCode")],
study_instance_uid: Annotated[Union[str, None], Query(alias="studyInstanceUid")],
):
请求体参数校验 非必填defalut =None
class AIMDcmReciprocalZipRequest(BaseModel):
model_config = ConfigDict(alias_generator=to_camel)
request_id: str = Field(
..., min_length=32, alias="requestId", description="发起请求ID"
)
pacs_url: str = Field(..., min_length=5, alias="pacsUrl", description="地址")
本文来自博客园,作者:vx_guanchaoguo0,转载请注明原文链接:https://www.cnblogs.com/guanchaoguo/p/18355481