Skip to content

Invalid JSON in CodeQL action models #23147

Open

Description

@woodruffw

Description of the issue

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.

Example:

// workflow_call receives the same event payload as the calling workflow

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions