Skip to content

Invalid argument ​

invalid_argumentHTTP 400Retrying the same request will not help

The request does not match the schema, so nothing ran.

Why it happens ​

  • An argument has the wrong type, or is missing when the schema requires it.
  • A value is outside the @range the schema declares, such as qty: 50 where the maximum is 10.
  • The batch envelope is not valid JSON, or a shape does not parse.

What to do ​

  • Read detail: it names the argument or the position in the request.
  • Compare the request with the schema, or open the explorer, which shows every argument with its type and range.

What it looks like ​

Inside a batch, the operation's frame carries it:

json
{
  "id": 1,
  "error": {
    "code": "invalid_argument",
    "message": "buy().qty: must be <= 10"
  },
  "fin": true
}

retryable appears only where it differs from the code's default, which is the one at the top of this page.

When the whole request is refused over HTTP, the answer is a problem document:

json
{
  "type": "https://eddyboutros.github.io/rayfold/errors/invalid_argument",
  "title": "invalid argument",
  "status": 400,
  "detail": "buy().qty: must be <= 10",
  "code": "invalid_argument"
}

See also all error types and the errors chapter of the specification.

Released under the Apache-2.0 license.