openapi-json-schema-tools / openapi-json-schema-generator

OpenAPI JSON Schema Generator allows auto-generation of API client libraries with a focus on JSON schema given an OpenAPI document
Apache License 2.0
152 stars 15 forks source link

[REQ] Run static checker on generated python code #1

Closed spacether closed 1 year ago

spacether commented 2 years ago

Is your feature request related to a problem? Please describe.

More an opportunity than a problem. Static type analysis is getting more popular in python. This complements testing in helping reduce bugs in the generated code. Additionally it will help make sure that the generated code is typed in a way that helps consumers with their own static analysis.

Describe the solution you'd like

Now that the python-experimental branch doesn't' support python 2 it's possible to run mypy (static analysis) on the code as part of tox. This would require a number of fixes/changes to be applied to the generator to get it working

Describe alternatives you've considered

There are a number of other type checkers available for python but mypy seems the most common at this time

spacether commented 2 years ago

One can add missing types from 3rd party packages with:

          - "types-python-dateutil"
          - "types-frozendict"
          - "types-typing-extensions"
          - "types-urllib3"

Per https://github.com/dominodatalab/python-domino/pull/155/commits/14ff565dc21ec5a0b823c9cf0b36e05925b3a0dc thank you @ddl-olsonJD

spacether commented 1 year ago

The upcoming v3 release will be closer to being able to run mypy

spacether commented 1 year ago

resolved by 3.0.0 release