Open AndyOGo opened 2 years ago
I fixed the { [k: string]: unknown; }
with oneOf
.
Though the types are still not imported, but instead included and duplicated in each file.
Sp probably related to #476
Mind adding a self contained repro?
@bcherny I think I'm running into the same issue
Using npx json2ts infile.json outfile.ts
, this schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "https://json.schemastore.org/package.json"
}
]
}
produces this typedef:
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export type Package = JSONSchemaForNPMPackageJsonFiles;
export type JSONSchemaForNPMPackageJsonFiles = {
[k: string]: unknown;
};
Generated types of referenced schemas are not imported, instead they are output as:
maybe related #471