Open
Description
Thanks for this really useful library! I was just wondering if this library supports relative references? The following is an example of what I'm trying to achieve:
import { FromSchema } from "json-schema-to-ts";
const types = {
$id: "https://example.local/types/",
$schema: "http://json-schema.org/draft-07/schema#",
definitions: {
foo: {
$ref: "#/definitions/bar",
},
bar: {
type: "integer",
},
},
} as const;
const root = {
$ref: "https://example.local/types/#/definitions/foo",
} as const;
type Root = FromSchema<
typeof root,
{
references: [typeof types];
}
>;
Version 2.7.2
currently resolves Root
to never
, whereas I was expecting it to resolve to number
.
Metadata
Metadata
Assignees
Labels
No labels