json-schema-to-ts icon indicating copy to clipboard operation
json-schema-to-ts copied to clipboard

Getting `unknown` as result type

Open jahirfiquitiva opened this issue 1 year ago • 1 comments

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!

jahirfiquitiva avatar Jan 24 '24 04:01 jahirfiquitiva

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

ThomasAribart avatar Jan 26 '24 10:01 ThomasAribart