jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
56 stars 58 forks source link

document and test that errors are spat out in a defined order #223

Closed DrHyde closed 3 years ago

DrHyde commented 3 years ago

The code change in lib/JSON/Validator.pm appears to be redundant at the moment, as the tests passed without it, but I'm putting it there anyway so that any future internals changes that affect ordering don't suddenly start causing test failures.

Summary

The list of errors spat out by ...->validate() are now guaranteed to be in a predictable order, which is documented.

Motivation

Documenting the order of errors makes it easier to write tests for error conditions.

References

https://github.com/mojolicious/json-validator/issues/222

jhthorsen commented 3 years ago

Thanks for the PR. This is now part of version 4.05.

I did forget to squash the commits though. Please help me next time, by force pushing changes.

DrHyde commented 3 years ago

Thanks