File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,12 @@ def _maybe_add_fallback_schema_name(a: PropertySpecification):
222222 schema ["title" ] = a ["name" ].title ()
223223
224224
225+ def _clean_description (text : str ) -> str :
226+ """Flatten new-lines and collapse excess whitespace."""
227+ text = text .replace ("\\ n" , " " ).replace ("\n " , " " )
228+ return re .sub (r"\s+" , " " , text ).strip ()
229+
230+
225231def parse_arguments (
226232 function_name : str , arguments : List [PropertySpecification ]
227233) -> Tuple [str , str ]:
@@ -248,8 +254,8 @@ def parse_arguments(
248254 if not a .get ("required" , True ):
249255 arg_string += " = None"
250256
251- description = a .get ("description" , "" )
252- description = description . replace ( " \n " , " " )
257+ description = _clean_description ( a .get ("description" , "" ) )
258+
253259 if description :
254260 if idx == len (arguments ) - 1 :
255261 arg_string += f" # { description } \n "
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
33
44[project ]
55name = " polyapi-python"
6- version = " 0.3.7.dev3 "
6+ version = " 0.3.7.dev4 "
77description = " The Python Client for PolyAPI, the IPaaS by Developers for Developers"
88authors = [{ name = " Dan Fellin" , email = " dan@polyapi.io" }]
99dependencies = [
You can’t perform that action at this time.
0 commit comments