A downstream tool accepts only JSON, and it rejects a policy file with a parse error on a line reading "// approved exception". Engineers want to keep the rationale with each setting and reject files missing required fields. What should the team do?
Show the answer
Correct answerB. Store the note in a string field and enforce a JSON Schema
AWhy not this: # comments are TOML and YAML syntax, not valid JSON, so the file would still fail to parse despite the schema.
BWhy this is right: A string field is valid JSON data that keeps the note with the setting, and JSON Schema enforces required fields and types.
CWhy not this: <!-- --> comments and XSD belong to XML; a JSON parser rejects the markers and an XSD cannot validate JSON.
DWhy not this: Strict mode enforces JSON syntax, which has no comments, so the note still fails and required fields are not checked.
JSON has no comment syntax, so the rationale must live in the data, such as a string field, and a JSON Schema can require fields and types. Strict parsing makes comments fail rather than be accepted.