This specification defines a generic problem-details container with only a minimal set of attributes to make it usable.
It is expected that applications will extend the base format by defining new attributes.
These new attributes fall into two categories: generic and application specific.
Generic attributes will be allocated in the
standard-problem-detail-entries slot according to the registration procedure defined in
Section 3.1.
Application-specific attributes will be allocated in the
custom-problem-detail-entries slot according to the procedure described in
Section 3.2.
Consumers of a Concise Problem Details data item
MUST ignore any Standard Problem Detail entries or Custom Problem Detail entries, or keys inside the Custom Problem Detail entries, that they do not recognize ("ignore-unknown rule"); this allows problem details to evolve. When storing the data item for future use or forwarding it to other consumers, it is strongly
RECOMMENDED to retain the unrecognized entries; exceptions might be when storage or forwarding occurs in a different format/protocol that cannot accommodate them or when the storage or forwarding function needs to filter out privacy-sensitive information and for that needs to assume unrecognized entries might be privacy-sensitive.
Beyond the Standard Problem Detail keys defined in
Figure 2, additional Standard Problem Detail keys can be registered for use in the
standard-problem-detail-entries slot (see
Section 6.1).
Standard Problem Detail keys are negative integers, so they can never conflict with Custom Problem Detail keys defined for a specific application domain (which are unsigned integers or URIs.)
In summary, the keys for Standard Problem Detail entries are in a global namespace that is not specific to a particular application domain.
Section 2 provides a number of generally applicable Standard Problem Detail entries. The present section both registers another useful Standard Problem Detail entry and serves as an example of a Standard Problem Detail Entry registration, in the registration template format that would be ready for registration.
-
Key value:
-
-8
-
Name:
-
unprocessed-coap-option
-
CDDL type:
-
one-or-more<uint>, where
one-or-more<T> = T / [ 2* T ]
-
Brief description:
-
Option number(s) of CoAP option(s) that were not understood
-
Specification reference:
-
Section 3.1.1 of RFC 9290
The specification of the Standard Problem Detail entry referenced by the above registration template follows:
The Standard Problem Detail entry
unprocessed-coap-option provides the option number or numbers of any CoAP options present in the request that could not be processed by the server.
This may be a critical option that the server is unaware of, or an option the server is aware of but could not process (and chose not to, or was not allowed to, ignore it).
The Concise Problem Details data item including this Standard Problem Detail Entry can be used in fulfillment of the "
SHOULD" requirement in
Section 5.4.1 of
RFC 7252.
Several option numbers may be given in a list (in no particular order), without any guarantee that the list is a complete representation of all the problems in the request (as the server might have stopped processing already at one of the problematic options). If an option with the given number was repeated, there is no indication which of the values caused the error.
Clients need to expect to see options in the list that they did not send in the request; this can happen if the request traversed a proxy that added the option but did not act on the problem-details response being returned by the origin server.
For a few special values of unprocessed CoAP options (such as Accept or Proxy-Uri), note that there are special response codes (4.06 Not Acceptable, 5.05 Proxying Not Supported, respectively) to be sent instead of 4.02 Bad Option.
Applications may extend the Concise Problem Details data item with additional entries to convey additional, application-specific information.
Such new entries are allocated in the
custom-problem-detail-entries slot and carry a nested map specific to that application. The map key can be either an (absolute!) URI (under control of the entity defining this extension) or an unsigned integer. Only the latter needs to be registered (
Section 6.2).
Within the nested map, any number of attributes can be given for a single extension. The semantics of each custom attribute
MUST be described in the documentation for the extension; for extensions that are registered (i.e., are identified by an unsigned int), that documentation goes along with the registration.
The unsigned integer form allows a more compact representation. In exchange, authors are expected to comply with the required registration and documentation process. In comparison, the URI form is less space efficient but requires no registration. Therefore, it is useful for experimenting during the development cycle and for applications deployed in environments where producers and consumers of Concise Problem Details are more tightly integrated. (Thus, the URI form covers the potential need we might otherwise have for a "Private Use" range for the unsigned integers.)
Note that the URI given for the extension is for identification purposes only and, even if dereferenceable in principle, it
MUST NOT be dereferenced in the normal course of handling problem details (i.e., outside diagnostic or debugging procedures involving humans).
Figure 3 shows an example (in CBOR diagnostic notation) of a custom extension using a (made-up) URI as the
custom-problem-detail-entries key.
{
/ title / -1: "title of the error",
/ detail / -2: "detailed information about the error",
/ instance / -3: "coaps://pd.example/FA317434",
/ response-code / -4: 128, / 4.00 /
"tag:3gpp.org,2022-03:TS29112": {
/ cause / 0: "machine-readable error cause",
/ invalidParams / 1: [
[
/ param / "first parameter name",
/ reason / "must be a positive integer"
],
[
/ param / "second parameter name"
]
],
/ supportedFeatures / 2: "d34db33f"
}
}
Obviously, a Standards Development Organization (SDO) like 3GPP can also easily register such a Custom Problem Detail entry to receive a more efficient unsigned integer key;
Figure 4 shows how the same example would look using a (made-up) registered unsigned int as the
custom-problem-detail-entries key:
{
/ title / -1: "title of the error",
/ detail / -2: "detailed information about the error",
/ instance / -3: "coaps://pd.example/FA317434",
/ response-code / -4: 128, / 4.00 /
/4711 is made-up example key that is not actually registered:/
4711: {
/ cause / 0: "machine-readable error cause",
/ invalidParams / 1: [
[
/ param / "first parameter name",
/ reason / "must be a positive integer"
],
[
/ param / "second parameter name"
]
],
/ supportedFeatures / 2: "d34db33f"
}
}
In summary, the keys for the maps used inside Custom Problem Detail entries are defined specifically for use with the identifier of that Custom Problem Detail entry, the documentation of which defines these internal entries, typically chosen to address a given application domain.
When there is a need to evolve a Custom Problem Detail entry definition, the "ignore-unknown rule" discussed in
Section 3 provides an easy way to include additional information. The assumption is that this is done in a backward- and forward-compatible way. Sometimes, Custom Problem Detail entries may need to evolve in a way where forward compatibility by applying the "ignore-unknown rule" would not be appropriate: for example, when adding a "must-understand" member, which can only be ignored at the peril of misunderstanding the Concise Problem Details data item ("false interoperability"). In this case, a new Custom Problem Detail key can simply be registered for this case, keeping the old key backward and forward compatible.