Skip to content

Commit

Permalink
check to make sure there's a $ref
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Nov 29, 2023
1 parent 927c49b commit 2a2721c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ def fail(self, message):


def expand_ref(self, ref):
refName = ref["$ref"].replace("#/components/schemas/", "")
return self.generate_schema_scaffold(json.loads(json.dumps(self.schema[refName])))
if "$ref" in ref:
refName = ref["$ref"].replace("#/components/schemas/", "")
return self.generate_schema_scaffold(json.loads(json.dumps(self.schema[refName])))
return ref["type"]


def generate_schema_scaffold(self, schema_obj):
Expand Down

0 comments on commit 2a2721c

Please sign in to comment.