10000 decode field formats · dd/python-openapi-codec@c376ffb · GitHub
[go: up one dir, main page]

Skip to content

Commit c376ffb

Browse files
committed
decode field formats
1 parent baa97e0 commit c376ffb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openapi_codec/decode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def _parse_document(data, base_url=None):
4444
name=field_name,
4545
location='form',
4646
required=is_required,
47-
schema=coreschema.String(description=field_description)
47+
schema=coreschema.String(description=field_description, format=field_format)
4848
)
49-
for field_name, is_required, field_description in expanded
49+
for field_name, is_required, field_description, field_format in expanded
5050
if not any([field.name == field_name for field in fields])
5151
]
5252
fields += expanded_fields
@@ -188,7 +188,7 @@ def _expand_schema(schema):
188188
schema_required = _get_list(schema, 'required')
189189
if ((schema_type == ['object']) or (schema_type == 'object')) and schema_properties:
190190
return [
191-
(key, key in schema_required, schema_properties[key].get('description'))
191+
(key, key in schema_required, schema_properties[key].get('description'), schema_properties[key].get('format'))
192192
for key in schema_properties.keys()
193193
]
194194
return None

0 commit comments

Comments
 (0)
0