jhthorsen / json-validator

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

Add OpenAPI schema classes #189

Closed jhthorsen closed 4 years ago

jhthorsen commented 4 years ago

Summary

This change aims to make it possible to move logic from JSON::Validator into the different JSON::Validator::Schema subclasses, but at the same time be backward compatible. After merging this PR, I need to update Mojolicious::Plugin::OpenAPI before moving the actual validation methods. (I think)

Motivation

Same motivation as #209.

References

209 and #210

karenetheridge commented 4 years ago

What is the purpose of the subclasses OpenAPIv2 and OpenAPIv3?

jhthorsen commented 4 years ago

What is the purpose of the subclasses OpenAPIv2 and OpenAPIv3?

They are part of the validation family. JSON::Validator is a generic validator, meaning it's only the schemas that enforces a given version.

jhthorsen commented 4 years ago

I think this branch is ready for merging now, but I'll keep it open until I'm done with jhthorsen/mojolicious-plugin-openapi#160

jhthorsen commented 4 years ago

I'm going to close this for now and open a new PR later on. Going to focus on making J::V compatible with the existing M::P::OpenAPI first.