Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Commit 107c4d4

Browse files
author
zhouwei
committed
+ body extra properties
1 parent baa97e0 commit 107c4d4

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

openapi_codec/encode.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,19 @@ def _get_parameters(link, encoding):
163163
}
164164
if field_type == 'array':
165165
schema_property['items'] = {'type': 'string'}
166+
167+
# ----------------- zw start ---------------------
168+
if hasattr(field, "schema") and hasattr(field.schema, "properties"):
169+
schema_property['properties'] = {k:vars(v) for k,v in dict(field.schema.properties).items()}
170+
for k,v in schema_property['properties'].items():
171+
pro = {}
172+
for kk, vv in v.items():
173+
if vv:
174+
pro[kk] = vv
175+
pro['type'] = "string"
176+
schema_property['properties'][k] = pro
177+
# ----------------- zw end ---------------------
178+
166179
properties[field.name] = schema_property
167180
if field.required:
168181
required.append(field.name)

0 commit comments

Comments
 (0)