Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: Chunked request in requestes

Open
#580 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start with the requests integration and the RequestsOpenAPIRequest implementation; the issue provides a proposed RequestsOpenAPIRequestFix that buffers generator request bodies and normalizes the MIME type. Reproduce validation of a chunked request, then verify that the request is buffered and validation succeeds without breaking image bodies or non-generator bodies.

Written by the indexing model from the issue text.

Description

kind/bug kind/bug/confirmed
Actual Behavior

Raise exception when tried validate chunked request

Expected Behavior

Buffer request and use for validation

Steps to Reproduce

validate chunked request

OpenAPI Core Version

0.17.1

OpenAPI Core Integration

requests

Affected Area(s)

No response

References

No response

Anything else we need to know?

FIX:

class RequestsOpenAPIRequestFix(RequestsOpenAPIRequest):
    def __init__(self, *args):
        super().__init__(*args)
        self._body_buffer = ''

    @property
    def mimetype(self) -> str:
        return super().mimetype.split(';')[0]

    @property
    def body(self) -> Optional[str]:
        if isinstance(self.request.body, types.GeneratorType):
            for part in self.request.body:
                self._body_buffer += part.decode('utf-8')
            return self._body_buffer
        if self.mimetype.startswith('image'):
            return None
        return super().body
Would you like to implement a fix?

None

Dominant language
Python
Stars
368
Forks
140
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-openapi/openapi-core

All issues in python-openapi/openapi-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.