ostrowr / ts-json-validator

Let JSON play nicely with Typescript
MIT License
342 stars 7 forks source link

Fix if?/then?/else? types and add tests #45

Closed mdurling closed 3 years ago

mdurling commented 3 years ago

@ostrowr I took a stab at resolving the issues I was having with #44. Feel free to make any necessary adjustments.

ostrowr commented 3 years ago

Oh! Thanks so much for taking care of this!

mdurling commented 3 years ago

As long as you’re ok with the fundamental change to the underlying types I proposed, I can add a test for if/then. It should be just a subset of the if/then/else tests I added, although I might try testing an array of if/then (no else) schemas within an allOf for fun. :-)

ostrowr commented 3 years ago

As long as you’re ok with the fundamental change to the underlying types I proposed, I can add a test for if/then. It should be just a subset of the if/then/else tests I added, although I might try testing an array of if/then (no else) schemas within an allOf for fun. :-)

Yes, definitely. It looks like the old types were just a bug. Changes to package-lock are OK too.

mdurling commented 3 years ago

@ostrowr I think this is ready now. Will you have time to review, merge, and publish a new version?