Extract properties from JSON Schema inside allOf

25 Views Asked by At

One useful feature of TypeScript is the ability to extract types from a JSON file, with the typeof keyword, like so:

import someSchema from './schema.json'

export type SomeProperties = typeof someSchema.properties

However, if the properties are within conditionals like allOf this approach doesn't work. Does anybody know how to extract types from JSON Schema in this scenario?

0

There are 0 best solutions below