Skip to content

[Bug] JsonParseNode.get_child_node raises ValueError for empty or None input #559

@gntikos

Description

@gntikos

An early guard in get_child_node raises a ValueError if an empty or None input is given.

Given that the method returns an Optional[ParseNode], this is unnecessary, since it can just return None without breaking any documented behavior.
Besides this, it breaks auto-generated code which calls get_child_node("") when there is no discriminator which is why I marked it as Bug.

The proposed solution is to simply remove that guard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done ✔️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions