cyprieng / swagger-parser

Give useful informations about your swagger files
MIT License
62 stars 59 forks source link

Message after validate #63

Closed 1frag closed 3 years ago

1frag commented 3 years ago

What about?

Earlier, when we validated the response:

parser.validate_definition(
    definition_name='definition_name',
    dict_to_test=response,
)

we will get True or False. Usually, when we got False we want analyze problem. And now you can use

parser.validate_definition(
    definition_name=definition_name,
    dict_to_test=data,
    return_error_message=True,
)

And will got (bool, str) like (False, 'Expected integer type, but got test1') See more in test_msg_after_validate