ThomasAribart / json-schema-to-ts

Infer TS types from JSON schemas 📝
MIT License
1.43k stars 30 forks source link

Using release >= 2.9.0 leads to Type instantiation is excessively deep and possibly infinite.deno-ts(2589) #150

Open tomas-zijdemans-vipps opened 1 year ago

tomas-zijdemans-vipps commented 1 year ago

I'm using Deno and the sample code as shown below. However, if I upgrade to 2.9.0 or 2.9.1 I get: "Type instantiation is excessively deep and possibly infinite.deno-ts(2589)" on the last line (FromSchema)

import { FromSchema } from "https://deno.land/x/json_schema_to_ts@v2.8.7/index.d.ts";

const objectSchema = {
  type: "object",
  properties: {
    foo: { type: "string" },
    bar: { type: "number" },
  },
  required: ["foo"],
} as const;

type Object = FromSchema<typeof objectSchema>;
lucgagan commented 1 year ago

I am getting this in older versions too (v2.8.2)

floratmin commented 10 months ago

Also in node and 2.9.2