Closed marekpiotrowski closed 9 months ago
The source code has not been amalgamated. @marekpiotrowski Please read and follow the Contribution Guidelines.
The source code has not been amalgamated. @marekpiotrowski Please read and follow the Contribution Guidelines.
Hey @nlohmann !
Hope you're having a great day!
After reading the guidelines and your discussion around comments in JSON, I got a feeling that this PR has no chance at all :D So, I was about to start writing documentation and considering I'd like to avoid redundant work, I though it'd make sense to check with you first.
Long story short, it's about annotating custom classes (annotations known at compile time) and dumping those when serializing (please see the tests or the example):
would produce:
If you'd ever consider merging this PR and allowing attachment of annotations known at compile time, I'll make sure that the documentation is consistent, code is amalgamated, will check the coverage, make sure redundant files are cleaned up etc. as per the guidelines. However, if you think it's a bad idea to introduce such functionality, I'm happy to keep this as a fork. I'll occasionally merge to your latest changes I guess.
The reason is that we've got plenty of JSON configuration files which are supposed to be filled by non-technical people. We use your brilliant plugin cus it's very robust and allows for ignoring comments when parsing. We've been annotating the dumped JSONs with some hard-core text manipulations in "post-processing", but it's horrible. Maintaining such documentation outside of the code is pretty much impossible so we had no choice though.
But now I thought that I could slightly extend your serializer and convenient macros for annotating the properties of custom classes.
Please let me know if there's any chance we could merge such functionality. If that's not the case, I'll have to prepare the documentation differently ;)
Cheers, Marek