Closed maartenbreddels closed 8 months ago
Hi! 👋
Firstly, thanks for your work on this project! 🙂
I used patch-package to patch typescript-json-schema@0.62.0 for the project I'm working on; it's an easier way to propose a fix than to open a PR.
typescript-json-schema@0.62.0
I had your tool crash on a bigint, and this seems to solve my problem:
diff --git a/node_modules/typescript-json-schema/dist/typescript-json-schema.js b/node_modules/typescript-json-schema/dist/typescript-json-schema.js index b230291..e6fb7af 100644 --- a/node_modules/typescript-json-schema/dist/typescript-json-schema.js +++ b/node_modules/typescript-json-schema/dist/typescript-json-schema.js @@ -482,6 +482,11 @@ var JsonSchemaGenerator = (function () { definition.properties = {}; definition.additionalProperties = true; } + else if (propertyTypeString === "bigint") { + definition.type = "number"; + definition.properties = {}; + definition.additionalProperties = false; + } else { var value = extractLiteralValue(propertyType); if (value !== undefined) { @@ -558,6 +563,7 @@ var JsonSchemaGenerator = (function () { } } } + else { var error = new TypeError("Unsupported type: " + propertyTypeString); error.type = propertyType;
I hope this is helpful.
Regards,
Maarten
This issue body was partially generated by patch-package.
I had the same issue on 0.63.0, and this solution worked.
Please send a pull request if you'd like this feature supported.
Done in #596
Hi! 👋
Firstly, thanks for your work on this project! 🙂
I used patch-package to patch
typescript-json-schema@0.62.0
for the project I'm working on; it's an easier way to propose a fix than to open a PR.I had your tool crash on a bigint, and this seems to solve my problem:
I hope this is helpful.
Regards,
Maarten
This issue body was partially generated by patch-package.