-
Notifications
You must be signed in to change notification settings - Fork 0
parse json as such #379
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
parse json as such #379
Conversation
d5b95f0 to
6fa76fc
Compare
Test Diff ReportNothing had changed in tests. |
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| if not isinstance(document, (dict, list)): | ||
| raise DocumentIsScalar(document) | ||
|
|
||
| return document |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated ensure_not_scalar function already exists
Medium Severity
The ensure_not_scalar function is duplicated. An identical implementation already exists in yaml_ld/document_parsers/yaml_parser.py (lines 25-30). The markdown_parser.py already imports and uses the existing function from yaml_parser.py, which is the correct pattern to follow.


JSONDocumentParserNote
Medium Risk
Changes how JSON and JSON-LD documents are parsed and which parser is selected for common content types, which could affect existing consumers expecting YAML-style behavior or error semantics. The change is localized but impacts document loading paths.
Overview
JSON/JSON-LD documents are now parsed as JSON. This introduces
JSONDocumentParser(UTF-8 decode +json.loads, rejects scalar documents) and registers it forapplication/jsonandapplication/ld+jsonindocument_loaders/content_types.py(previously routed toYAMLDocumentParser).Bumps package version to
1.1.17and adds a minimalflake8config (max-imports = 15) insetup.cfg.Written by Cursor Bugbot for commit 928e5cb. This will update automatically on new commits. Configure here.