Skip to content

[ISSUE]: safe_get_json inconsistent contract for JSON root types #469

Closed

Description

@Aditya8369

Description

Issue: The function only enforces that the JSON root is an object (dict) when force=False. If a caller ever sets force=True (or relies on the current semantics), arrays/primitives can pass, breaking downstream validation expectations.

Fix: Add a new parameter like require_object: bool = True and enforce dict-root unconditionally when enabled; update callers/tests that truly need non-object roots.

Additional Context

No response

Activity

  1. Aditya8369 commented on May 11, 2026

    @Aditya8369
    ContributorAuthor

    @devanshi14malhotra assign me please

  2. added
    NSoC'26For issues and PRs which are a part of the Nexus Spring of Code open source event
    on May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NSoC'26For issues and PRs which are a part of the Nexus Spring of Code open source eventbackendlevel25 points

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions