Skip to content

Plug.Parsers.JSON should always wrap parsed content #1130

Closed
@amplexdenmark

Description

@amplexdenmark

Currently as documented non object JSON is wrapped in a Map with a "_json" key to the parsed content.
But object JSON is returned as is.

This leads to the situation that parsing:
{"_json":[]}
cannot be distinguished from parsing:
[]

They both leads to the same result: %{"_json" => []}

The fix is not to handle objects specially, but always return the parsed content in a Map with "_json" key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions