davishmcclurg / json_schemer

JSON Schema validator. Supports drafts 4, 6, 7, 2019-09, 2020-12, OpenAPI 3.0, and OpenAPI 3.1.
MIT License
408 stars 64 forks source link

$id of invalid type throws an exception #174

Closed ekzobrain closed 9 months ago

ekzobrain commented 9 months ago
schemer = JSONSchemer.schema({ "$id" => 1 })
schemer.valid_schema?

throws an exception "bad argument (expected URI object or URI string) (ArgumentError)". Shouldn't it return a validation error instead of an unhandled exception?

davishmcclurg commented 9 months ago

throws an exception "bad argument (expected URI object or URI string) (ArgumentError)". Shouldn't it return a validation error instead of an unhandled exception?

Yep, you're right. I'm going to close this because I think it's covered by: https://github.com/davishmcclurg/json_schemer/issues/167

I've got a fix in the works.