nickel-lang / json-schema-to-nickel

Convert JSON schemas into Nickel contracts
Apache License 2.0
32 stars 0 forks source link

Fix wrong predicate for external refs #71

Closed yannham closed 6 months ago

yannham commented 6 months ago

External refs are now replaced with Dyn contract since #70. The corresponding predicate is predicates.always. We were incorrectly using definitions.predicate.always instead, which might not even be defined - definitions are specific to each JSON schema.

vkleen commented 6 months ago

Maybe we could have a test JSON schema that doesn't contain a toplevel always? I'm a bit suprised that the test suite didn't catch this...

yannham commented 6 months ago

Well before #70 we used to panick on external refs, so I guess no test in the test suite could possibly test for this code path. But yeah, might be worth adding a test for this now.

vkleen commented 6 months ago

Ah, of course. Maybe there's even explicitly disabled tests with external references in the test suite, then.