fix: 🐛 another windows fix in typegen.js
This commit is contained in:
parent
dc0622848b
commit
f38c8fb8b3
1 changed files with 1 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ const { compile } = require("json-schema-to-typescript");
|
|||
|
||||
function generateTypesForFile(inputPath, outputPath) {
|
||||
let schema = JSON.parse(fs.readFileSync(inputPath, "utf8"));
|
||||
let name = (inputPath.split("/").pop() || inputPath).split(".")[0];
|
||||
let name = path.parse(path.basename(inputPath)).name;
|
||||
// This is to solve the issue of json-schema-to-typescript not supporting $ref at the top-level, which is what Pydantic generates for recursive types
|
||||
if ("$ref" in schema) {
|
||||
let temp = schema["$ref"];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue