jsontypedef / json-typedef-codegen

A CLI tool that generates code from JSON Typedef schemas
https://jsontypedef.com/docs/tools/jtd-codegen
MIT License
160 stars 31 forks source link

jtd-codegen can not correctly parse the output schema files from jtd-infer (Windows 11) #92

Open HvR-PA opened 1 month ago

HvR-PA commented 1 month ago

Using the current versions for jtd-infer (v0.2.1) and jtd-codegen (v.0.4.1) aren't compatible with each other on Windows 11.

jtd-infer outputs the file in UTF-16 LE when this same file is used as input for jtd-codegen you will get the following error: Error: Failed to parse input as JSON

Caused by: expected value at line 1 column 1

This is cause by the fact that jtd-codegen can not interpret UTF-16 LE formatted text files correctly. Converting to or copying and saving the contents of the jtd schema output from jtd-infer to UTF8 is a temporary workaround.