Skip to content

method.optional_unhandled

An optional value reaches a place that needs a required one

Type https://mthds.ai/errors/method.optional_unhandled
Family method: The method as written, the validation vocabulary included.
Domain method: the method's author acts, by changing the method
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

A maybe-absent input or output is used where a value is required: it escapes through a step, a sequence or a condition whose boundary is not optional, a PipeCondition can continue without producing its output while that output is not ?, a template reads it without a guard, or a maybe-absent PipeParallel branch feeds a required structured field.

What to do

Guard the read, declare the receiving output or field optional with ?, or force the input with ! when it is always present at that point.

Next steps

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

Reader Kind Detail
The domain's actor change_method Guard '{input}' where it is used, or declare the receiving side optional, then validate the method again.
Any other reader contact_owner Ask the method's owner to guard the optional '{input}' in pipe '{pipe}'.

Detail

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

In pipe '{pipe}', the maybe-absent '{input}' reaches a place that needs a value (site: {site}).

Parameters

Every parameter is present on every occurrence of the code.

Name Type Description
pipe identifier The pipe at fault.
input identifier The maybe-absent input or output.
site one of sequence_step, condition, condition_output, template, parallel_branch Where the value escapes: sequence_step when it escapes through a step or a sequence whose boundary is not optional, condition when it escapes through a condition whose boundary is not optional, condition_output when a PipeCondition can continue without producing its output while that output is not ?, template when a template reads it without a guard, and parallel_branch when a maybe-absent PipeParallel branch feeds a required structured field.

See also