From 144d00a44b6f4b8f371ad33405300a7908514b04 Mon Sep 17 00:00:00 2001 From: Jurica Zeleznjak Date: Thu, 27 Jul 2017 15:33:40 +0200 Subject: [PATCH] Use provided Field schema (if it exists) Allows for nice overrides when using it with django-rest-swagger --- openapi_codec/encode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi_codec/encode.py b/openapi_codec/encode.py index 13b3ef4..8a2054d 100644 --- a/openapi_codec/encode.py +++ b/openapi_codec/encode.py @@ -171,7 +171,7 @@ def _get_parameters(link, encoding): # https://github.com/OAI/OpenAPI-Specification/issues/50#issuecomment-112063782 schema = {'type': 'string', 'format': 'binary'} else: - schema = {} + schema = getattr(field, 'schema', {}) parameter = { 'name': field.name, 'required': field.required,