[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.

Assessment

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

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.

Description

Enhancement: Feature

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
Dominant language
Java
Stars
26.8k
Forks
7.7k
Avg merge
1d 10h
Merged PRs (30d)
103

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 OpenAPITools/openapi-generator

All issues in OpenAPITools/openapi-generator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.