Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Understand Validation Error Messages#768

Answeredbyp1c2u
xingyuanmoodys asked this question inQ&A
Discussion options

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!

You must be logged in to vote

Replies: 1 comment

Comment options

Please read more aboutHandling Validation Errors

You must be logged in to vote
0 replies
Answer selected byp1c2u
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@xingyuanmoodys@p1c2u

[8]ページ先頭

©2009-2025 Movatter.jp