본문 바로가기

The Boxer

검색하기
The Boxer
프로필사진 Prower

  • 분류 전체보기 (67)
    • Django (5)
    • Git (4)
    • Java (6)
    • Data Structure (1)
    • Computer Science (20)
      • Software Engineering (3)
      • Serialization (1)
      • Computer Architecture (0)
      • Network (9)
      • Database (1)
      • Operating System (4)
    • Development (2)
    • Python (9)
    • Storage (9)
      • Druid (6)
      • DynamoDB (2)
    • Fastapi (2)
    • Devops (6)
    • 용어정리 (2)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
  • pydantic
  • Druid
  • java
  • CallBack
  • dynamodb
  • cloudwatch
  • Cloud
  • FastAPI
  • TEST
  • AWS
  • pydnatic
  • serverless
  • Python
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록pydnatic (1)

The Boxer

pydantic 모델 파싱시 비어있는 필드에 대해

pydantic 모델 파싱시 주의 사항 request나 response로 넘어온 body data를 pydantic이 model로 파싱하는 과정에서 정의된 필드가 비어있는 경우 에러를 던진다. 에러가 발생하는 예시 from pydantic import BaseModel ​ class Foo(BaseModel): id: int name: str ​ def service_method() -> dict: return { "name": "testing" } ​ def controller_method() -> Foo: result = service_method() return Foo(**result) ​ controller_method() pydantic은 모델로 데이터를 파싱하는 과정에서 파싱이 불가능한 값이 ..

Python 2022. 8. 7. 01:32
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바