Skip to content

Conversation

@dafeder
Copy link
Member

@dafeder dafeder commented Apr 15, 2025

Fixes #17

This switches RootedJsonData to use justinrainbow/json-schema as its JSON validation library, replacing OPIs JSON Schema 1.x.

Overall the RootedJsonData API should behave similarly, but of course some paradigms have changed. Error handling has been moved to a new ErrorHelper class, which is fairly small now but could be expanded.

Opis can validate schemas directly, while justinrainbow only validates schemas as part of data validation. So rather than validating the schema before attempting to validate the data, we are validating once and catching schema validation exceptions.

The major change to the API will be that the errors returned with our exceptions are in a different format. So any code that consumes that data will need to be updated. Merging this PR requires a new major version of the library.

@dafeder dafeder marked this pull request as draft April 15, 2025 17:29
@dafeder dafeder marked this pull request as ready for review April 17, 2025 20:46
@dafeder
Copy link
Member Author

dafeder commented Apr 18, 2025

Switched to allow justinrainbow/json-schema 5.x, as core is still not on 6.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade Opis or move to justinrainbow/json-schema

2 participants