ostrowr / ts-json-validator

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

Support $ref along with definitions #9

Open ostrowr opened 5 years ago

ostrowr commented 5 years ago

Right now, schemas that use $ref get an unknown type.

Dealing with JSON Pointer through the type system seems like it will be a nightmare.

Maybe it's possible to enforce that the $id field is required in definitions, and that each ref points to one of those ids? Then we would resolve the right type without too much trouble.

ostrowr commented 5 years ago

https://json-schema.org/understanding-json-schema/structuring.html#using-id-with-ref