Skip to content

Ensure schema JSON documents are valid JSON #996

@mike-north

Description

@mike-north

Currently, the presence of comments

https://github.com/Microsoft/web-build-tools/blob/138e943e283e4a5a271094389a89bce80861b676/apps/api-extractor/src/api/api-json.schema.json#L5-L12

and at least one trailing comma

https://github.com/Microsoft/web-build-tools/blob/138e943e283e4a5a271094389a89bce80861b676/apps/api-extractor/src/api/api-json.schema.json#L662-L665

makes these files way more difficult to work with than ideal (i.e., consumers cannot use JSON.parse)

Comments are easy to deal with thanks to strip-json-comments, but the trailing comma is a bit more annoying.

Suggestion

In CI, strip comments and run schema JSON documents through a json validator of some sort

Version

    "@microsoft/api-extractor": "^6.3.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions