Skip to content

Commit bfea9c6

Browse files
author
Tom Reitz
committed
bugfix based on testing
1 parent 3317258 commit bfea9c6

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

lightbeam/api.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,16 +367,11 @@ def get_identity_params_from_swagger(self, swagger, definition, prefix=""):
367367
self.logger.critical(f"Swagger contains neither `definitions` nor `components.schemas` - check that the Swagger is valid.")
368368

369369
for prop in schema["properties"]:
370-
if prop.endswith("Reference") and "required" in schema.keys() and prop in schema['required']:
371-
sub_definition = schema["properties"][prop]["$ref"]
372-
sub_schema = util.resolve_swagger_ref(swagger, sub_definition)
373-
for sub_prop in sub_schema["required"]:
374-
params[f"{prop}.{sub_prop}"] = sub_prop
375-
elif "$ref" in schema["properties"][prop].keys():
370+
if prop.endswith("Reference") and "required" in schema.keys() and prop in schema['required'] and "$ref" in schema["properties"][prop].keys():
376371
sub_definition = schema["properties"][prop]["$ref"]
377372
sub_params = self.get_identity_params_from_swagger(swagger, sub_definition, prefix=prop+".")
378373
for k,v in sub_params.items():
379374
params[k] = v
380-
elif schema["properties"][prop]["type"]!="array" and "x-Ed-Fi-isIdentity" in schema["properties"][prop].keys():
375+
elif "type" in schema["properties"][prop].keys() and schema["properties"][prop]["type"]!="array" and "x-Ed-Fi-isIdentity" in schema["properties"][prop].keys():
381376
params[prop] = prefix + prop
382377
return params

0 commit comments

Comments
 (0)