swagger-api / swagger-api/swagger-codegen

[python] Add support to Accept-Encoding: GZIP

Open
#10,085 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Swagger codegen seems to be missing GZIP support on Python, this is a needed improvement in many use cases.

Related issues/PRs

Generic issue: #3365

Suggest a fix/enhancement

Since urllib3 automatically supports decoding gzip responses, this could be fixed by adding "Accept-Encoding: GZIP" header to the request.

Looking at the other implementation (#5525 #3365) raises a few questions:

  1. Should this option be configurable?
  2. Where should we add the option? (as default_headers in api_client, request() in rest)

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.

Research direction

Start by tracing the Python client's request flow through the mentioned api_client and rest entry points, comparing default_headers with request(). Resolve whether gzip support should be configurable and where the Accept-Encoding header belongs. Done means Python-generated clients advertise GZIP consistently and the chosen behavior is covered by the relevant request handling tests, if present.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.