pydantic 欄位欄位校驗

vx_guanchaoguo0發表於2024-08-12

查詢餐資料校驗

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="地址")

相關文章