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

JSON output: flatten levels #226

Open
maria-messerschmidt opened this issue Jan 21, 2025 · 0 comments
Open

JSON output: flatten levels #226

maria-messerschmidt opened this issue Jan 21, 2025 · 0 comments

Comments

@maria-messerschmidt
Copy link

maria-messerschmidt commented Jan 21, 2025

The JSON output has a few redundant levels and would be easier to parse if the messages were structured as a flat array within each report.

Currently, this is the structure of the "messages" objects. I have marked with bold the levels that could be flattened. The "package" and "mimetype" objects can either be moved to the message level (as shown in the example below) or even to the parameters level (see #227).

{
"messages":{
"messages":{
"package":[

{
"id":"DOC-2",
"severity":"INFO",
"message":"OpenDocument version 1.3 detected.",
"subMessage":"",
"timestamp":"2025-01-17 07:03 UTC"
}
],
"mimetype":[
{"id":"DOC-3",
"severity":"INFO",
"message":"OpenDocument MIMETYPE .[..]..detected",
"subMessage":"",
"timestamp":"2025-01-17 07:03 UTC"
}
]
},
"warning_count":0,
"info_count":2,
"error_count":0
}
}

And the result would be something like this:

{
"messages":[
{
"location": "package",
"id":"DOC-2",
"severity":"INFO",
"message":"OpenDocument version 1.3 detected.",
"subMessage":"",
"timestamp":"2025-01-17 07:03 UTC"
}
{
"location": "mimetype"
"id":"DOC-3",
"severity":"INFO",
"message":"OpenDocument MIMETYPE .[..]..detected",
"subMessage":"",
"timestamp":"2025-01-17 07:03 UTC"
}
]
"warning_count":0,
"info_count":2,
"error_count":0
}

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

No branches or pull requests

1 participant