ThomasAribart / json-schema-to-ts

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

Getting `unknown` as result type #184

Closed jahirfiquitiva closed 4 months ago

jahirfiquitiva commented 5 months ago

Hi, I'm trying to parse the JSON schema from this JSON file: https://github.com/jsonresume/resume-schema/blob/master/schema.json

Anyway, when doing so, I just get unknown as the result type.

This is my code:

import type { FromSchema, JSONSchema } from 'json-schema-to-ts';
import resumeSchema from 'resume-schema/schema.json';
const schema = resumeSchema as const;
export type ResumeSchema = FromSchema<typeof schema>;

Shot 2024-01-23 at 23 16 40@2x

Would you mind guiding me on what I'm doing wrong? Thanks in advance!

ThomasAribart commented 5 months ago

Yup, it's all there: https://github.com/ThomasAribart/json-schema-to-ts/blob/main/documentation/FAQs/does-json-schema-to-ts-work-on-json-file-schemas.md