Open timothyliu opened 1 year ago
Thank you! json-schema-to-ts is good job for me, but this case I need your support:
const testSchema = { $id: 'test', type: 'object', patternProperties: { '^[\\w_$]+$': { title: '自定義樣式', type: 'object', anyOf: [ { properties: { street: { type: 'string', }, city: { type: 'string', }, state: { type: 'string', }, }, }, { properties: { type: { enum: ['residential', 'business',], }, }, }, ], }, }, } as const const addressSchema = { type: 'object', allOf: [ { properties: { address: { type: 'string', }, city: { type: 'string', }, state: { type: 'string', }, }, required: ['address', 'city', 'state',], }, { properties: { type: { enum: ['residential', 'business',], }, }, }, { $ref: 'test', }, ], } as const export type Address = FromSchema<typeof addressSchema, { references: [ typeof testSchema ] }> // Address ==> never
Thank you! json-schema-to-ts is good job for me, but this case I need your support: