brandur / json_schema

A JSON Schema V4 and Hyperschema V4 parser and validator.
MIT License
230 stars 45 forks source link

Handle expansion for nested external property #108

Closed kytrinyx closed 5 years ago

kytrinyx commented 5 years ago

If you have a schema that has a reference to an object definition in a separate schema, then there are three possibilities. The object properties in the second schema could be:

  1. actual properties
  2. references to definitions within the same schema
  3. references to definitions within a separate schema

When expanding references in the first schema, it would correctly handle both cases 1 and 2, but not 3.

This adds a test for this use case, as well as the code to fix it.

kytrinyx commented 5 years ago

It looks like the build is failing because of a dependency thing. I don't think I messed with any dependencies, so I'm wondering if this is transient.

brandur commented 5 years ago

It looks like the build is failing because of a dependency thing. I don't think I messed with any dependencies, so I'm wondering if this is transient.

It looks like Byebug recently changed its specification to Ruby 2.3 or above. We really don't need Byebug for non-local development anyway. I'll write a quick fix for that.

kytrinyx commented 5 years ago

We really don't need Byebug for non-local development anyway.

That's a good point. Thanks! I'll rebase this once you've got the fix in.

brandur commented 5 years ago

This looks good to me — thanks for the follow up fix!

I just pulled in #109. Can you rebase the pull request? After that I'll merge and cut a patch release.

kytrinyx commented 5 years ago

Alright, rebased and it looks like it's passing.

brandur commented 5 years ago

Released as 0.20.3. Thanks again!

kytrinyx commented 5 years ago

Thanks for the quick turnaround, @brandur !