mholt / json-to-go

Translates JSON into a Go type in your browser instantly (original)
https://mholt.github.io/json-to-go/
MIT License
4.51k stars 475 forks source link

Convert with annotations #145

Open zweix123 opened 1 month ago

zweix123 commented 1 month ago

This is a great tool.

I have an idea that although annotations are not included in the Json standard, they have been widely implemented; Can our tool also place the corresponding comments after the converted fields while parsing Json?

mholt commented 1 month ago

That's probably okay to support, but hmm, that might be complicated since we just traverse the parsed JSON structure as a JS value, so the comments would have to be reconstructed from manual parsing somehow. I'm not sure it's worth the complexity...