OpenAPITools / OpenAPITools/openapi-generator

[REQ] Generated python code should be checked with `mypy --strict` - currently only tested with `mypy`

Open Beginner friendly
#20,959 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

TLDR

Currently generated code is run through mypy but with a fairly loose configuration. Generated code would be significantly better, if it were validated with a strict type-checker.

Describe the solution you'd like

Apply this patch here:

      - name: mypy
        working-directory: ${{ matrix.sample }}
+        run: python -m mypy --strict
-        run: python -m mypy

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

Open .github/workflows/samples-python-client-echo-api.yaml around the existing mypy step and review how the sample matrix invokes it. Update the validation to use strict checking, then run the affected workflow or equivalent sample checks and confirm generated Python clients pass mypy --strict.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd, testing
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.