Skip to content

input.wrong_multiplicity

An input has the wrong number of items

Type https://mthds.ai/errors/input.wrong_multiplicity
Family input: A run's inputs.
Domain input: the caller acts, by changing the request or its inputs
Retry no: repeating the operation fails the same way
HTTP status 422
Raised as a problem document, sent as the body of an HTTP response or kept in a run's record

What it means

The request gives a list where the method expects one item, one item where it expects a list, or a list of the wrong length.

What to do

Give one item for a single input, a list for a list input, and exactly params.expected_count items for an input of a fixed count.

Next steps

A problem carries the step aimed at whoever reads it: the first when its reader is the domain's actor, the caller, and the second for any other reader.

Reader Kind Detail
The domain's actor change_input Give the input '{input}' with the multiplicity the method declares, then send the request again.
Any other reader change_input Pass this to the caller, who must give the input '{input}' with the multiplicity the method declares.

Detail

The problem's detail is written from this template, filled with the occurrence's parameters:

The input '{input}' gives {provided_count} item or items, which does not fit the multiplicity the method declares ({expected}).

Parameters

A parameter is present on every occurrence of the code unless it is marked optional, and one marked operator-only reaches only whoever runs the runtime, never a caller.

Name Type Description
input identifier The input at fault.
expected one of single, list, count What the method expects: one item, a list of any length, or a list of a fixed length.
expected_count integer (optional) The number of items the method expects, when it expects a fixed count.
provided_count integer The number of items the request gives.

See also