You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error is thrown in the JSONSchemaInput.ts file: line #1040 and is caused by the URI implementation.
The library 'urijs' library parses the absolute path and the drive letter is mistaken for a protocol, and therefore fails to deduct a filename which in-turn causes the code to fail.
This now works and produces valid output instead of throwing "Cannot infer name for schema". The root cause skornel02 diagnosed was correct: urijs was misparsing the drive letter as a URI scheme, leaving the filename empty. Paths are now routed through a dedicated Windows path handler (WindowsPaths.ts, added for #2869) that converts drive-style paths to proper file:/// URIs before they reach the schema resolver, so the name is inferred correctly. This fix will be in the next release. If you can still reproduce the failure on a current build, please reopen or comment with the exact command and quicktype version you used.
Activity
virtuoushub commentedon Nov 20, 2018
As a workaround. have you tried:
Difference being,
--src G:\Protocol\Schema\Protocol_0.1.schema=>--src G:/Protocol/Schema/Protocol_0.1.schemaI have noticed this makes a difference when running on Windows.
skornel02 commentedon May 20, 2020
The error is thrown in the JSONSchemaInput.ts file: line #1040 and is caused by the URI implementation.
The library 'urijs' library parses the absolute path and the drive letter is mistaken for a protocol, and therefore fails to deduct a filename which in-turn causes the code to fail.
In my testing this did not make a difference.
Using relative source is a good workaround, but the unit tests use absolute path, and will cause windows systems to fail json scheme fixtures
Conditionally disabled schema tests glideapps#1113
Conditionally disabled schema tests glideapps#1113
schani commentedon Jul 20, 2026
I retested this on current master (built from source at 662ad5b) using a drive-style Windows path:
node dist/index.js --src 'G:/Protocol/Schema/Protocol_0.1.schema' --src-lang schema --lang csThis now works and produces valid output instead of throwing "Cannot infer name for schema". The root cause skornel02 diagnosed was correct: urijs was misparsing the drive letter as a URI scheme, leaving the filename empty. Paths are now routed through a dedicated Windows path handler (WindowsPaths.ts, added for #2869) that converts drive-style paths to proper file:/// URIs before they reach the schema resolver, so the name is inferred correctly. This fix will be in the next release. If you can still reproduce the failure on a current build, please reopen or comment with the exact command and quicktype version you used.