Hello! I'm using thevalidate_response function to validate my JSON response against OpenAI spec. It does raise errors, but the message is pretty confusing, below is the validation error raised, I'm wondering if there's any way I could know which field in my spec or JSON response is raising the error? This kind of massive "None for not of type xx" really doesn't help much. They way I printed this was like this: try: validate_response_swagger(response) except ValidationError as e: print(e)
... not valid for schema of type object: (<ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'array'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'array'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'number'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'number'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'array'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'number'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'array'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'number'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'string'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'number'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'number'">, <ValidationError: 'None for not nullable'>, <ValidationError: "None is not of type 'number'">, <ValidationError: 'None for not nullable'>)
Thank you! |