Closed Charlie-Mindified closed 1 year ago
if content-type isn't application/json json_input is never set but is still accessed on row 26 in parameter_validation.py. throws error: UnboundLocalError: local variable 'json_input' referenced before assignment
request_inputs = { Route: kwargs.copy(), Json: json_input, Query: request.args.to_dict(), Form: request.form.to_dict(), File: request.files.to_dict() } example of solution request_inputs = { Route: kwargs.copy(), Json: json_input if 'json_input' in vars() else None, Query: request.args.to_dict(), Form: request.form.to_dict(), File: request.files.to_dict() }
request_inputs = { Route: kwargs.copy(), Json: json_input, Query: request.args.to_dict(), Form: request.form.to_dict(), File: request.files.to_dict() }
request_inputs = { Route: kwargs.copy(), Json: json_input if 'json_input' in vars() else None, Query: request.args.to_dict(), Form: request.form.to_dict(), File: request.files.to_dict() }
Closed by #11, thanks again!
if content-type isn't application/json json_input is never set but is still accessed on row 26 in parameter_validation.py. throws error: UnboundLocalError: local variable 'json_input' referenced before assignment
request_inputs = { Route: kwargs.copy(), Json: json_input, Query: request.args.to_dict(), Form: request.form.to_dict(), File: request.files.to_dict() }
example of solutionrequest_inputs = { Route: kwargs.copy(), Json: json_input if 'json_input' in vars() else None, Query: request.args.to_dict(), Form: request.form.to_dict(), File: request.files.to_dict() }