[Bug]: Chunked request from request libraly

Đang mở
#554 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

Start with the requests integration entry points RequestsOpenAPIRequest, RequestsOpenAPIResponse, and unmarshal_response, then reproduce the failure using the chunk_generator example. Trace how the request body is inspected during unmarshaling. Done means a chunked request no longer triggers the assertion and the chunked body is checked as far as supported.

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

Mô tả

kind/bug kind/bug/confirmed
Actual Behavior

When it shout check response where request data was chunked it fails.

    @property
    def body(self) -> Optional[str]:
        if self.request.body is None:
            return None
        if isinstance(self.request.body, bytes):
            return self.request.body.decode("utf-8")
>       assert isinstance(self.request.body, str)
E       AssertionError
Expected Behavior

Check everithing which can, ideally chunked body itself.

Steps to Reproduce
    @staticmethod
    def chunk_generator(data):
        for block in raw:
            yield block
request = Request(method, url, headers=headers, data=chunk_generator(data), **kwargs)
response = session.send(session.prepare_request(request))  
openapi_request = RequestsOpenAPIRequest(request)
openapi_response = RequestsOpenAPIResponse(response)
unmarshal_response(openapi_request, openapi_response, self.spec)
OpenAPI Core Version

0.17.1

OpenAPI Core Integration

requests

Affected Area(s)

unmarshaling

References

No response

Anything else we need to know?

No response

Would you like to implement a fix?

None

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.