From dd817005545f0b06ba0fbf963816507397167fef Mon Sep 17 00:00:00 2001 From: Chuan-Heng Hsiao Date: Fri, 4 Aug 2023 14:27:52 -0400 Subject: [PATCH] apidoc: check schema in params --- apidoc/parameters.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apidoc/parameters.py b/apidoc/parameters.py index 7b6b73f..c63cbd5 100755 --- a/apidoc/parameters.py +++ b/apidoc/parameters.py @@ -39,6 +39,11 @@ def _is_not_authorization(x): if '$ref' in each: val = re.sub(r'#/definitions', '#/components/schemas', each['$ref']) each['$ref'] = val + if 'schema' in each: + schema = each['schema'] + if '$ref' in schema: + val = re.sub(r'#/definitions', '#/components/schemas', schema['$ref']) + schema['$ref'] = val data_by_method['parameters'] = params2 # definitions