OpenAPITools / OpenAPITools/openapi-generator
[REQ][Python-flask] Option to remove docstrings / noqa / comments
Open
Nobody has claimed this yet.
Enhancement: Feature
Server: Python
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Would it be possible to add a option that removes all non-required text in generated model files?
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 this:
class ConnectionInfo(Model):
def __init__(self, name=None):
self.openapi_types = {
'name': str
}
self.attribute_map = {
'name': 'name'
}
self.name = name
@property
def name(self):
return self._name
@name.setter
def name(self, name):
self._name = name
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Python-Flask generator's model-template and option-handling entry points; the issue does not name specific files or tests. Compare generated model output with and without the proposed option, and consider the work complete when docstrings, noqa markers, and non-required comments are omitted without removing required code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, openapi, python
- Domain
- backend-api-design, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100