swagger-api / swagger-api/swagger-codegen

[Python] support type hints

Open
#5,429 19 comments 34 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Python Enhancement: Feature help wanted Server: Python
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

We want to support type hints, which was introduced for Python 3.5+. The feature will be added to Python API client as well as server (Flask).

Since this option is for 3.5+ only, we will need to use the option supportPython2 to selectively disable it if supportPython2 (default to false) is set to true

Python version: 3.5+

Ref: https://www.python.org/dev/peps/pep-0484/

Suggest a Fix

If anyone from the community has questions/suggestions or wants to work on it, please reply to let us know. Thank you.

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 reading PEP 484 and locating the Python API client and Flask server templates, then inspect how the supportPython2 option is handled. Done means generated Python 3.5+ client and server code supports type hints while type hints are selectively disabled when supportPython2 is true.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
api, backend, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.