Skip to content

Gracefully handle POSTs with a single object not in an array #3

@awendland

Description

@awendland

The POST endpoint expects objects to be in an array, however, users may submit a single object that isn't nested in an array. The endpoint should check for this an wrap it in an array if necessary.

For example this should work instead of returning an error:

body={"type":"article","uri":"https:\/\/stackoverflow.com\/questions\/5725430\/http-test-server-accepting-get-post-requests"}
-->
response={"statusCode":400,"payload":{"message":"The request body must be in the form [{\"header1\": \"value1\", \"header2\": \"value2\"}, ...]"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions