Skip to content

Commit fd829c5

Browse files
fix: Prevent special characters in descriptions from breaking docstrings
1 parent 302cd02 commit fd829c5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

openapi_python_client/templates/endpoint_macros.py.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ json_body=json_body,
141141
{% endmacro %}
142142

143143
{% macro docstring(endpoint, return_string) %}
144-
"""{% if endpoint.summary %}{{ endpoint.summary | wordwrap(100)}}
144+
r"""{% if endpoint.summary %}{{ endpoint.summary | wordwrap(100)}}
145145

146146
{% endif -%}
147147
{%- if endpoint.description %} {{ endpoint.description | wordwrap(100) }}

openapi_python_client/templates/model.py.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ T = TypeVar("T", bound="{{ class_name }}")
3535

3636
@attr.s(auto_attribs=True)
3737
class {{ class_name }}:
38-
"""{% if model.title %}{{ model.title | wordwrap(116) }}
38+
r"""{% if model.title %}{{ model.title | wordwrap(116) }}
3939

4040
{% endif -%}
4141
{%- if model.description %}{{ model.description | wordwrap(116) }}

openapi_python_client/templates/package_init.py.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" {{ package_description }} """
1+
r""" {{ package_description }} """
22
from .client import AuthenticatedClient, Client
33

44
__all__ = (

0 commit comments

Comments
 (0)