From 304bc0f4a42fa200c394b545cb419ca106bb9cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lafr=C3=A9choux?= Date: Fri, 9 Nov 2018 14:43:28 +0100 Subject: [PATCH] Revert "Remove unused kwargs in Api.definition decorator" This reverts commit 0ed8a5b803929fcb2e5bf3b44b6b50936684217f. Those kwargs can be used when not calling definition in decoration mode: api.definition('Pet')(PetSchema, extra_fields={'x-field': 'value'}) --- flask_rest_api/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flask_rest_api/__init__.py b/flask_rest_api/__init__.py index 406d5510..82e5a14b 100644 --- a/flask_rest_api/__init__.py +++ b/flask_rest_api/__init__.py @@ -102,11 +102,11 @@ def definition(self, name): class PetSchema(Schema): ... """ - def decorator(schema_cls): + def decorator(schema_cls, **kwargs): if APISPEC_VERSION_MAJOR < 1: - self.spec.definition(name, schema=schema_cls) + self.spec.definition(name, schema=schema_cls, **kwargs) else: - self.spec.components.schema(name, schema=schema_cls) + self.spec.components.schema(name, schema=schema_cls, **kwargs) return schema_cls return decorator