Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow comments in json #105

Open
LDAP opened this issue Jun 1, 2020 · 6 comments
Open

Allow comments in json #105

LDAP opened this issue Jun 1, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@LDAP
Copy link
Contributor

LDAP commented Jun 1, 2020

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
Copy link
Contributor

larsk21 commented Jun 2, 2020

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
Copy link
Contributor Author

LDAP commented Jun 2, 2020

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
Copy link
Contributor

larsk21 commented Jun 2, 2020

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?

@larsk21 larsk21 added the enhancement New feature or request label Jun 2, 2020
@LDAP
Copy link
Contributor Author

LDAP commented Jun 2, 2020

This would be a suitable alternative

@larsk21
Copy link
Contributor

larsk21 commented Jun 2, 2020

@gstuer Do you have any preferences here?

@gstuer
Copy link
Contributor

gstuer commented Jun 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants