News for hackers. Stuff that matters.
Re:Show HN: JSONSchema to TypeScript compiler by bcherny on Wednesday April 26, 2017 @02:47PM (#14205823)
JSONSchema has a concept of "$refs", which is a way to encode a pointer to a value in a JSONSchema. $refs can point to another node in the same graph, a node in another JSONSchema on the same filesystem, or a node in another JSONSchema fetched over the network.

$refs are used in JSONSchema, but are described in the separate JSONPointer spec [0].

See unit tests for examples:

- In-file $ref: https://github.com/bcherny/json-schema-to-typescript/blob/ma...

- Local $ref: https://github.com/bcherny/json-schema-to-typescript/blob/ma...

- Remote $ref: https://github.com/bcherny/json-schema-to-typescript/blob/ma...

- Cyclical $ref: https://github.com/bcherny/json-schema-to-typescript/blob/ma...

Hope that helps!

[0] https://tools.ietf.org/html/rfc6901

There are no comments on this comment yet.