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="地址")
posted @ 2024-08-12 18:02  vx_guanchaoguo0  阅读(9)  评论(0编辑  收藏  举报