File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class OpenApiYamlRenderer(BaseRenderer):
15
15
16
16
def render (self , data , accepted_media_type = None , renderer_context = None ):
17
17
# disable yaml advanced feature 'alias' for clean, portable, and readable output
18
- class Dumper (yaml .SafeDumper ):
18
+ class Dumper (yaml .CSafeDumper ):
19
19
def ignore_aliases (self , data ):
20
20
return True
21
21
@@ -51,7 +51,9 @@ def uuid_representer(dumper, data):
51
51
Dumper .add_representer (UUID , uuid_representer )
52
52
53
53
def safestring_representer (dumper , data ):
54
- return dumper .represent_str (data )
54
+ # CSafeDumper needs actually a str instance, not a SafeString one.
55
+ # str(SafeString()) still returns SafeString.
56
+ return dumper .represent_str (super (SafeString , data ).__str__ ())
55
57
Dumper .add_representer (SafeString , safestring_representer )
56
58
57
59
def ordereddict_representer (dumper , data ):
You can’t perform that action at this time.
0 commit comments