forked from loafle/openapi-generator-original
python: ignore long lines for model descriptions (#16518)
Descriptions can easily exceed line-length limits because they are often extracted from doc/comments strings, which may use unexpected formatting. Python doc strings, in particular, are likely to use newlines, which mustache does not preserve, causing descriptions to be condensed to a single line.
This commit is contained in:
parent
0192baed42
commit
b34a10aee7
@ -12,7 +12,7 @@ import json
|
|||||||
|
|
||||||
class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}):
|
class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}):
|
||||||
"""
|
"""
|
||||||
{{{description}}}{{^description}}{{{classname}}}{{/description}}
|
{{#description}}{{{description}}} # noqa: E501{{/description}}{{^description}}{{{classname}}}{{/description}}
|
||||||
"""
|
"""
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
{{name}}: {{{vendorExtensions.x-py-typing}}}
|
{{name}}: {{{vendorExtensions.x-py-typing}}}
|
||||||
@ -358,4 +358,4 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
|
|||||||
{{{.}}}
|
{{{.}}}
|
||||||
{{/vendorExtensions.x-py-postponed-model-imports}}
|
{{/vendorExtensions.x-py-postponed-model-imports}}
|
||||||
{{classname}}.update_forward_refs()
|
{{classname}}.update_forward_refs()
|
||||||
{{/vendorExtensions.x-py-postponed-model-imports.size}}
|
{{/vendorExtensions.x-py-postponed-model-imports.size}}
|
||||||
|
@ -25,7 +25,7 @@ from openapi_client.models.string_enum_ref import StringEnumRef
|
|||||||
|
|
||||||
class DefaultValue(BaseModel):
|
class DefaultValue(BaseModel):
|
||||||
"""
|
"""
|
||||||
to test the default value of properties
|
to test the default value of properties # noqa: E501
|
||||||
"""
|
"""
|
||||||
array_string_enum_ref_default: Optional[conlist(StringEnumRef)] = None
|
array_string_enum_ref_default: Optional[conlist(StringEnumRef)] = None
|
||||||
array_string_enum_default: Optional[conlist(StrictStr)] = None
|
array_string_enum_default: Optional[conlist(StrictStr)] = None
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictStr
|
|||||||
|
|
||||||
class ClassModel(BaseModel):
|
class ClassModel(BaseModel):
|
||||||
"""
|
"""
|
||||||
Model for testing model with \"_class\" property
|
Model for testing model with \"_class\" property # noqa: E501
|
||||||
"""
|
"""
|
||||||
var_class: Optional[StrictStr] = Field(None, alias="_class")
|
var_class: Optional[StrictStr] = Field(None, alias="_class")
|
||||||
__properties = ["_class"]
|
__properties = ["_class"]
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictStr
|
|||||||
|
|
||||||
class File(BaseModel):
|
class File(BaseModel):
|
||||||
"""
|
"""
|
||||||
Must be named `File` for test.
|
Must be named `File` for test. # noqa: E501
|
||||||
"""
|
"""
|
||||||
source_uri: Optional[StrictStr] = Field(None, alias="sourceURI", description="Test capitalization")
|
source_uri: Optional[StrictStr] = Field(None, alias="sourceURI", description="Test capitalization")
|
||||||
__properties = ["sourceURI"]
|
__properties = ["sourceURI"]
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictStr
|
|||||||
|
|
||||||
class HealthCheckResult(BaseModel):
|
class HealthCheckResult(BaseModel):
|
||||||
"""
|
"""
|
||||||
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. # noqa: E501
|
||||||
"""
|
"""
|
||||||
nullable_message: Optional[StrictStr] = Field(None, alias="NullableMessage")
|
nullable_message: Optional[StrictStr] = Field(None, alias="NullableMessage")
|
||||||
__properties = ["NullableMessage"]
|
__properties = ["NullableMessage"]
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr
|
|||||||
|
|
||||||
class Model200Response(BaseModel):
|
class Model200Response(BaseModel):
|
||||||
"""
|
"""
|
||||||
Model for testing model name starting with number
|
Model for testing model name starting with number # noqa: E501
|
||||||
"""
|
"""
|
||||||
name: Optional[StrictInt] = None
|
name: Optional[StrictInt] = None
|
||||||
var_class: Optional[StrictStr] = Field(None, alias="class")
|
var_class: Optional[StrictStr] = Field(None, alias="class")
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictInt
|
|||||||
|
|
||||||
class ModelReturn(BaseModel):
|
class ModelReturn(BaseModel):
|
||||||
"""
|
"""
|
||||||
Model for testing reserved words
|
Model for testing reserved words # noqa: E501
|
||||||
"""
|
"""
|
||||||
var_return: Optional[StrictInt] = Field(None, alias="return")
|
var_return: Optional[StrictInt] = Field(None, alias="return")
|
||||||
__properties = ["return"]
|
__properties = ["return"]
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr
|
|||||||
|
|
||||||
class Name(BaseModel):
|
class Name(BaseModel):
|
||||||
"""
|
"""
|
||||||
Model for testing model name same as property name
|
Model for testing model name same as property name # noqa: E501
|
||||||
"""
|
"""
|
||||||
name: StrictInt = Field(...)
|
name: StrictInt = Field(...)
|
||||||
snake_case: Optional[StrictInt] = None
|
snake_case: Optional[StrictInt] = None
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictBool
|
|||||||
|
|
||||||
class ObjectToTestAdditionalProperties(BaseModel):
|
class ObjectToTestAdditionalProperties(BaseModel):
|
||||||
"""
|
"""
|
||||||
Minimal object
|
Minimal object # noqa: E501
|
||||||
"""
|
"""
|
||||||
var_property: Optional[StrictBool] = Field(False, alias="property", description="Property")
|
var_property: Optional[StrictBool] = Field(False, alias="property", description="Property")
|
||||||
__properties = ["property"]
|
__properties = ["property"]
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictStr
|
|||||||
|
|
||||||
class ClassModel(BaseModel):
|
class ClassModel(BaseModel):
|
||||||
"""
|
"""
|
||||||
Model for testing model with \"_class\" property
|
Model for testing model with \"_class\" property # noqa: E501
|
||||||
"""
|
"""
|
||||||
var_class: Optional[StrictStr] = Field(None, alias="_class")
|
var_class: Optional[StrictStr] = Field(None, alias="_class")
|
||||||
additional_properties: Dict[str, Any] = {}
|
additional_properties: Dict[str, Any] = {}
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictStr
|
|||||||
|
|
||||||
class File(BaseModel):
|
class File(BaseModel):
|
||||||
"""
|
"""
|
||||||
Must be named `File` for test.
|
Must be named `File` for test. # noqa: E501
|
||||||
"""
|
"""
|
||||||
source_uri: Optional[StrictStr] = Field(None, alias="sourceURI", description="Test capitalization")
|
source_uri: Optional[StrictStr] = Field(None, alias="sourceURI", description="Test capitalization")
|
||||||
additional_properties: Dict[str, Any] = {}
|
additional_properties: Dict[str, Any] = {}
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictStr
|
|||||||
|
|
||||||
class HealthCheckResult(BaseModel):
|
class HealthCheckResult(BaseModel):
|
||||||
"""
|
"""
|
||||||
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. # noqa: E501
|
||||||
"""
|
"""
|
||||||
nullable_message: Optional[StrictStr] = Field(None, alias="NullableMessage")
|
nullable_message: Optional[StrictStr] = Field(None, alias="NullableMessage")
|
||||||
additional_properties: Dict[str, Any] = {}
|
additional_properties: Dict[str, Any] = {}
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr
|
|||||||
|
|
||||||
class Model200Response(BaseModel):
|
class Model200Response(BaseModel):
|
||||||
"""
|
"""
|
||||||
Model for testing model name starting with number
|
Model for testing model name starting with number # noqa: E501
|
||||||
"""
|
"""
|
||||||
name: Optional[StrictInt] = None
|
name: Optional[StrictInt] = None
|
||||||
var_class: Optional[StrictStr] = Field(None, alias="class")
|
var_class: Optional[StrictStr] = Field(None, alias="class")
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictInt
|
|||||||
|
|
||||||
class ModelReturn(BaseModel):
|
class ModelReturn(BaseModel):
|
||||||
"""
|
"""
|
||||||
Model for testing reserved words
|
Model for testing reserved words # noqa: E501
|
||||||
"""
|
"""
|
||||||
var_return: Optional[StrictInt] = Field(None, alias="return")
|
var_return: Optional[StrictInt] = Field(None, alias="return")
|
||||||
additional_properties: Dict[str, Any] = {}
|
additional_properties: Dict[str, Any] = {}
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictInt, StrictStr
|
|||||||
|
|
||||||
class Name(BaseModel):
|
class Name(BaseModel):
|
||||||
"""
|
"""
|
||||||
Model for testing model name same as property name
|
Model for testing model name same as property name # noqa: E501
|
||||||
"""
|
"""
|
||||||
name: StrictInt = Field(...)
|
name: StrictInt = Field(...)
|
||||||
snake_case: Optional[StrictInt] = None
|
snake_case: Optional[StrictInt] = None
|
||||||
|
@ -23,7 +23,7 @@ from pydantic import BaseModel, Field, StrictBool
|
|||||||
|
|
||||||
class ObjectToTestAdditionalProperties(BaseModel):
|
class ObjectToTestAdditionalProperties(BaseModel):
|
||||||
"""
|
"""
|
||||||
Minimal object
|
Minimal object # noqa: E501
|
||||||
"""
|
"""
|
||||||
var_property: Optional[StrictBool] = Field(False, alias="property", description="Property")
|
var_property: Optional[StrictBool] = Field(False, alias="property", description="Property")
|
||||||
additional_properties: Dict[str, Any] = {}
|
additional_properties: Dict[str, Any] = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user