Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Body from `RequestValidationResult` not a dict anymore

Đang mở
#95 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api, backend

Hướng nghiên cứu

Start by tracing how RequestValidationResult exposes its body in openapi-core 0.6.0 and how the returned Model is represented. Reproduce the behavior with a Flask request and dacite, then review the expected boundary between validated model data and a plain dictionary. Done should be a decided, documented way to obtain the validated body representation.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi guys,

I upgraded openapi-core on my project to 0.6.0, and now when I get an instance of RequestValidationResult and try to access the request body, it's a Model instance now, and I can't get it easily transformed to a plain dictionary to be used elsewhere - for example with dacite.from_dict, which I'm also using together with openapi-core.

I could get the plain dict body from the Flask request instead, but it would be nice if I could keep using the result.body instead, as this leads to a better design - it makes it clear that the body was validated.

Any suggestions on how I should proceed? Can the library receive an implementation change so that it's easier to get the dict representation of the model? Or should I go on and use Flask's request object instead?

Thanks,
Diogo

Ngôn ngữ chính
Python
Star
368
Fork
140
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python-openapi/openapi-core

Tất cả issue của python-openapi/openapi-core

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.