Skip to content

CA2000 should report on JsonDocument instances returned from JsonDocument.Parse #6861

Open

Description

JsonDocument is disposable, and it's unfortunately common to see code that things like:

JsonElement json = JsonDocument.Parse(...).RootElement;

CA2000 should warn that the JsonDocument instance returned from Parse needs to be disposed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions