You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I figured I'd open a new issue for this, since the introducing PR (#23099) was already closed.
TL;DR: #23099 switched the CodeQL actions model definitions from YAML to JSON, but in the process produced what appear to be some invalid JSON files. In particular, some of the files contain //-style comments, which are not valid in JSON. Consequently, parsers like Python's json.loads fail/reject these model files instead of parsing them.
This is unfortunate for downstream consumers (like me), since the workaround is to use a JSON5 or other parser that claims support for comments. But this too is imprecise, since JSON5 is a much larger specification than just "JSON with comments" and there's no indication in the repo that the files were intended to be parsed as JSON5.
Expected behavior
The .json files in this repo would ideally be parseable with an RFC 8259 JSON parser.
Actual behavior
Some of the .json files in this repo contain invalid JSON.
Thanks for your input. We use Jackson to parse JSON files, and Jackson allows for comments in these files. Disallowing comments would in certain instances significantly reduce the readability of these files. I will check internally, but I do not think we want to start disallowing comments.
I maintain a tool, zizmor, that consumes CodeQL's data models for its own analysis. Previously I was extracting those from the YAML, and I noticed with the JSON change that the new files weren't actually valid JSON. I can work around that with a JSON5 parser, but I wasn't sure if it was intentional given the .json suffix.
Please feel free to close this if it's not planned/not something that can be considered. I was just hopeful it was an oversight, since doing non-standard grammar things isn't great from a langsec perspective.
@jketema Thanks for clarifying that it was a deliberate choice, could I ask that the file writers add the JSONC designation inline, as the JSONC spec advises, since the filenames are unlikely to be changed to .jsonc extension.
Having that marker allows tools to make a determination about the contents might be a low-effort solution?
I think that's a solution that's very error prone, as as adding that inline is easily forgotten unless we add CI checks for this, which adds a maintenance burden.
Just for clarity: zizmor is not a product (it's my personal side project), and GitHub is both a sponsor and user of it. I've talked and worked on-and-off with various CodeQL folks for years and have been a corporate paying user of it (including well before GitHub bought Semmle). So I don't really see the two as competing.
Activity
jketema commentedon Nov 17, 2026
Hi @woodruffw,
Thanks for your input. We use Jackson to parse JSON files, and Jackson allows for comments in these files. Disallowing comments would in certain instances significantly reduce the readability of these files. I will check internally, but I do not think we want to start disallowing comments.
woodruffw commentedon Nov 17, 2026
Hi @jketema, thanks for your response.
Wanting to retain the context makes sense. Would it be possible to switch to a compatible form, like writing comments as valid JSON keys?
For example:
(This is arguably a hack, but I would argue that relying on non-standard JSON parsing is also a hack 🙂)
jketema commentedon Nov 17, 2026
I checked internally, and it was a deliberate decision to allow comments, so we prefer not to backtrack on this.
It's also not clear to us what your use case is, but if this is unrelated to CodeQL we cannot offer support on this.
woodruffw commentedon Nov 17, 2026
I maintain a tool, zizmor, that consumes CodeQL's data models for its own analysis. Previously I was extracting those from the YAML, and I noticed with the JSON change that the new files weren't actually valid JSON. I can work around that with a JSON5 parser, but I wasn't sure if it was intentional given the
.jsonsuffix.Please feel free to close this if it's not planned/not something that can be considered. I was just hopeful it was an oversight, since doing non-standard grammar things isn't great from a langsec perspective.
jketema commentedon Nov 17, 2026
In that case, I'm closing this, as this was a deliberate choice.
miketheman commentedon Nov 17, 2026
@jketema Thanks for clarifying that it was a deliberate choice, could I ask that the file writers add the JSONC designation inline, as the JSONC spec advises, since the filenames are unlikely to be changed to
.jsoncextension.Having that marker allows tools to make a determination about the contents might be a low-effort solution?
jketema commentedon Nov 17, 2026
Hi @miketheman
I think that's a solution that's very error prone, as as adding that inline is easily forgotten unless we add CI checks for this, which adds a maintenance burden.
miketheman commentedon Nov 17, 2026
I hear you, I do. Instead, shifting the burden on to downstream JSON parsers feels ... wrong to me.
But it's your project.
jketema commentedon Nov 17, 2026
Our assumption is that these files will only every be used by CodeQL, and not by what seems - effectively - a competing product.
woodruffw commentedon Nov 17, 2026
Just for clarity: zizmor is not a product (it's my personal side project), and GitHub is both a sponsor and user of it. I've talked and worked on-and-off with various CodeQL folks for years and have been a corporate paying user of it (including well before GitHub bought Semmle). So I don't really see the two as competing.
(For example, this repo itself uses zizmor here.)