typebox-codegen icon indicating copy to clipboard operation
typebox-codegen copied to clipboard

ModelToTypeScript: Breaks on object keys with spaces

Open marcustyphoon opened this issue 1 year ago • 0 comments

ModelToTypeScript doesn't appear to quote object keys that have spaces in them, resulting in SyntaxError: Property or signature expected (when Prettier tries to format the resulting code, I assume).

Easy to see in the workbench (select "typescript transform"):

https://sinclairzx81.github.io/typebox-workbench/?share=Ly8gRWRpdCBUeXBlU2NyaXB0IFR5cGVzIEhlcmUuIFVzZSBDdHJsICsgUyB0byBTaGFyZQoKZXhwb3J0IHR5cGUgVCA9IHsKICAnaGVsbG8gd29ybGQnOiBudW1iZXIKfQ%3D%3D

marcustyphoon avatar Feb 13 '24 09:02 marcustyphoon