ThomasAribart / json-schema-to-ts

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

Support new `propertyNames` keyword #134

Open ThomasAribart opened 1 year ago

ThomasAribart commented 1 year ago
const mySchema = {
  type: "object",
  additionalProperties: { type: "number" },
  propertyNames: { enum: ["a", "b", "c" ] },
} as const;

type Test = FromSchema<typeof mySchema>

// => Record<"a" | "b" | "c", number>