Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #13806
Closed
Open
Issue created Oct 24, 2022 by Administrator@rootContributor

[REQ][Python-flask] Support type hints

Created by: nmoreaud

Would it be possible to add support for type hints in python flask generator? It would help me to reduce the number of bugs in my application.

Ex replace this:

class ConnectionInfo(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, name=None):  # noqa: E501
        """ConnectionInfo - a model defined in OpenAPI

        :param name: The name of this ConnectionInfo.  # noqa: E501
        :type name: str
        """
        self.openapi_types = {
            'name': str
        }

        self.attribute_map = {
            'name': 'name'
        }

        self.name = name

    @property
    def name(self):
        """Gets the name of this ConnectionInfo.

        Human-readable name of the connection.  # noqa: E501

        :return: The name of this ConnectionInfo.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this ConnectionInfo.

        Human-readable name of the connection.  # noqa: E501

        :param name: The name of this ConnectionInfo.
        :type name: str
        """

        self._name = name

with:

class ConnectionInfo(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, id:str=None, name=None, references=None, db_info=None):  # noqa: E501
        """ConnectionInfo - a model defined in OpenAPI"""
        self.openapi_types = {
            'name': str
        }

        self.attribute_map = {
            'name': 'name'
        }

        self.name = name

    @property
    def name(self) -> str:
        """Gets the name of this ConnectionInfo.
        Human-readable name of the connection."""
        return self._name

    @name.setter
    def name(self, name: str):
        """Sets the name of this ConnectionInfo.
        Human-readable name of the connection. """
        self._name = name
Assignee
Assign to
Time tracking