Skip to content

Commit 144d00a

Browse files
authored
Use provided Field schema (if it exists)
Allows for nice overrides when using it with django-rest-swagger
1 parent baa97e0 commit 144d00a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openapi_codec/encode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _get_parameters(link, encoding):
171171
# https://github.com/OAI/OpenAPI-Specification/issues/50#issuecomment-112063782
172172
schema = {'type': 'string', 'format': 'binary'}
173173
else:
174-
schema = {}
174+
schema = getattr(field, 'schema', {})
175175
parameter = {
176176
'name': field.name,
177177
'required': field.required,

0 commit comments

Comments
 (0)