const todo = { type: "object", additionalProperties: true, }; const shipSchema = { type: "object", properties: { schemaVersion: { const: "1" }, identification: { $ref: "#/$defs/identification" }, structure: { $ref: "#/$defs/todo" }, propulsion: { $ref: "#/$defs/todo" }, carrier: { $ref: "#/$defs/todo" }, weaponry: { $ref: "#/$defs/todo" }, }, additionalProperties: false, $defs: { identification: identificationSchema, todo, ...identificationSchema.$defs, }, } as const; import type { FromSchema } from "json-schema-to-ts"; import { identificationSchema } from "./identification/schema"; type Ship = FromSchema; export default shipSchema;