انتقل إلى المحتوى الرئيسي

Interface: RefusalCodeDefinition

Defined in: packages/contracts/src/refusal-codes.ts:26

What two deployables share about one refusal code.

Properties​

category​

readonly category: "validation" | "authorization" | "state" | "conflict" | "upstream" | "internal"

Defined in: packages/contracts/src/refusal-codes.ts:28

The category the module answers with (30). It decides the HTTP status.


field?​

readonly optional field?: string

Defined in: packages/contracts/src/refusal-codes.ts:46

The member of the HTTP request the refusal is about: body.<member> or query.<parameter>. Absent when it is about no one member.

What it is for depends on the category. For a validation code it is where the gateway points its field error (an errors[] entry, RFC 9457). For any other category it is informational only: the gateway maps nothing from it and it is never rendered as an errors[] entry, because field errors are validation's. It is there for a client that wants to show the refusal beside the input it concerns, even when that input was given in an earlier request.


title​

readonly title: string

Defined in: packages/contracts/src/refusal-codes.ts:34

The problem's title (RFC 9457): one short sentence, the same every time the code is answered. It never names a value and never says whether something the caller cannot read exists.