kit-sdq / TimeSheetGenerator

TimeSheetGenerator is an application that checks and builds time sheet documents.
MIT License
23 stars 6 forks source link

Allow comments in json #105

Open LDAP opened 4 years ago

LDAP commented 4 years ago

Parsing failes when json contains any comments.

Error output: "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)"

larsk21 commented 4 years ago

This is expected behavior and by design of the JSON parsing library, since JSON does not specify comments (see RFC 8259). As the error suggests, the parser does however support comments.

Do you have a use case in mind where we would benefit from comments in JSON files? @LDAP

LDAP commented 4 years ago

Yes. I was about to write additional information into the time sheet e.g. why certain meetings took longer than usual. Such information does not fit into the "Activity" field.

larsk21 commented 4 years ago

I see. Since comments in JSON are always a little messy, would it help to add an optional comment field to the JSON definition that is ignored by the parser?

LDAP commented 4 years ago

This would be a suitable alternative

larsk21 commented 4 years ago

@gstuer Do you have any preferences here?

gstuer commented 4 years ago

As @larsk21 stated correctly, JSON does not specify and consequently does not support comments, even if they are available within our specific parser. Therefore, I would prefer @larsk21 solution concerning the optional comment field. We could use this in the near future within the GUI #20.