Browse Source

support parameter references in swagger spec (#150)

Dennis Frommknecht 5 months ago
parent
commit
c5a393d50d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      http_prompt/context/__init__.py

+ 4 - 0
http_prompt/context/__init__.py

@@ -39,6 +39,10 @@ class Context(object):
                         params = info.get('parameters')
                         if params:
                             for param in params:
+                                if param.get("$ref"):
+                                    for section in param.get("$ref").split('/'):
+                                        param = param.get(section) if not section == "#" else spec
+
                                 if param.get('in') != 'path':
                                     full_path = path_tokens + [param['name']]
                                     self.root.add_path(*full_path,