prongs
GitHub

request.malformed

The request cannot be read: invalid JSON, the wrong content type

Profile

Raised with

Status

400

Message

yours
Read https://www.prongs.dev/docs/intents/request/malformed.md and tell me whether request.malformed fits what I am building.

Example

TS
return fail('request.malformed', 'Invalid JSON.');
The caller gets
Terminal
HTTP 400

{
"ok": false,
"error": "Invalid JSON.",
"code": "request.malformed"
}

Connections

Choosing between neighbours

  • If it is

    Use

  • The request cannot be read: invalid JSON, the wrong content type

    request.malformed
  • A readable request with a wrong value

    request.invalid

For registry authors

Starter intents. These are the intents prongs add errors puts in your registry, raised with fail(). Change the messages to suit your app, and the statuses through the status.* intents they are built from.

The entry prongs add errors writes into your registry. Change the message here, or the status through its status.* ref.

TS
'request.malformed': {
kind: 'semantic',
description: 'The request cannot be read: invalid JSON, the wrong content type',
refs: ['status.badrequest'],
keywords: ['json', 'parse', 'malformed'],
notFor: [
{
context: 'a readable request with a wrong value',
instead: 'request.invalid',
},
],
binding: { publicMessage: 'Invalid request.' },
},