Internet Engineering Task Force (IETF)                     M. Nottingham
Request for Comments: 7807                                        Akamai
Category: Standards Track                                       E. Wilde
ISSN: 2070-1721                                               March 2016

Problem Details for HTTP APIs

HTTP APIの問題の詳細



This document defines a "problem detail" as a way to carry machine-readable details of errors in a HTTP response to avoid the need to define new error response formats for HTTP APIs.

このドキュメントでは、HTTP APIの新しいエラー応答フォーマットを定義する必要をなくすために、HTTP応答でマシンが読み取り可能なエラーの詳細を伝える方法として「問題の詳細」を定義しています。

Status of This Memo


This is an Internet Standards Track document.

これはInternet Standards Trackドキュメントです。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

このドキュメントは、IETF(Internet Engineering Task Force)の製品です。これは、IETFコミュニティのコンセンサスを表しています。公開レビューを受け、インターネットエンジニアリングステアリンググループ(IESG)による公開が承認されました。インターネット標準の詳細については、RFC 5741のセクション2をご覧ください。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at


Copyright Notice


Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved.

Copyright(c)2016 IETF Trustおよびドキュメントの作成者として識別された人物。全著作権所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents ( in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

この文書は、BCP 78およびこの文書の発行日に有効なIETF文書に関するIETFトラストの法的規定(の対象となります。これらのドキュメントは、このドキュメントに関するあなたの権利と制限を説明しているため、注意深く確認してください。このドキュメントから抽出されたコードコンポーネントには、Trust Legal Provisionsのセクション4.eに記載されているSimplified BSD Licenseのテキストが含まれている必要があり、Simplified BSD Licenseに記載されているように保証なしで提供されます。

Table of Contents


   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Requirements  . . . . . . . . . . . . . . . . . . . . . . . .   3
   3.  The Problem Details JSON Object . . . . . . . . . . . . . . .   3
     3.1.  Members of a Problem Details Object . . . . . . . . . . .   5
     3.2.  Extension Members . . . . . . . . . . . . . . . . . . . .   6
   4.  Defining New Problem Types  . . . . . . . . . . . . . . . . .   6
     4.1.  Example . . . . . . . . . . . . . . . . . . . . . . . . .   7
     4.2.  Predefined Problem Types  . . . . . . . . . . . . . . . .   8
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .   8
   6.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   9
     6.1.  application/problem+json  . . . . . . . . . . . . . . . .   9
     6.2.  application/problem+xml . . . . . . . . . . . . . . . . .  10
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  11
     7.1.  Normative References  . . . . . . . . . . . . . . . . . .  11
     7.2.  Informative References  . . . . . . . . . . . . . . . . .  12
   Appendix A.  HTTP Problems and XML  . . . . . . . . . . . . . . .  14
   Appendix B.  Using Problem Details with Other Formats . . . . . .  15
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  16
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  16
1. Introduction
1. はじめに

HTTP [RFC7230] status codes are sometimes not sufficient to convey enough information about an error to be helpful. While humans behind Web browsers can be informed about the nature of the problem with an HTML [W3C.REC-html5-20141028] response body, non-human consumers of so-called "HTTP APIs" are usually not.

HTTP [RFC7230]ステータスコードは、役立つエラーに関する十分な情報を伝えるのに十分でない場合があります。 Webブラウザーの背後にいる人間は、HTML [W3C.REC-html5-20141028]応答本文の問題の性質について通知を受けることができますが、いわゆる「HTTP API」の人間以外のコンシューマーは通常通知されません。

This specification defines simple JSON [RFC7159] and XML [W3C.REC-xml-20081126] document formats to suit this purpose. They are designed to be reused by HTTP APIs, which can identify distinct "problem types" specific to their needs.

この仕様では、この目的に合わせてシンプルなJSON [RFC7159]およびXML [W3C.REC-xml-20081126]ドキュメント形式を定義しています。それらは、HTTP APIによって再利用されるように設計されており、HTTP APIは、ニーズに固有の「問題タイプ」を識別することができます。

Thus, API clients can be informed of both the high-level error class (using the status code) and the finer-grained details of the problem (using one of these formats).


For example, consider a response that indicates that the client's account doesn't have enough credit. The 403 Forbidden status code might be deemed most appropriate to use, as it will inform HTTP-generic software (such as client libraries, caches, and proxies) of the general semantics of the response.

たとえば、クライアントのアカウントに十分なクレジットがないことを示す応答を考えます。 403 Forbiddenステータスコードは、HTTP汎用ソフトウェア(クライアントライブラリ、キャッシュ、プロキシなど)に応答の一般的なセマンティクスを通知するため、使用するのが最も適切であると見なされる場合があります。

However, that doesn't give the API client enough information about why the request was forbidden, the applicable account balance, or how to correct the problem. If these details are included in the response body in a machine-readable format, the client can treat it appropriately; for example, triggering a transfer of more credit into the account.


This specification does this by identifying a specific type of problem (e.g., "out of credit") with a URI [RFC3986]; HTTP APIs can do this by nominating new URIs under their control, or by reusing existing ones.

この仕様は、URI [RFC3986]で特定のタイプの問題(たとえば、「信用できない」)を識別することによってこれを行います。 HTTP APIは、管理下にある新しいURIを指定するか、既存のURIを再利用することで、これを行うことができます。

Additionally, problem details can contain other information, such as a URI that identifies the specific occurrence of the problem (effectively giving an identifier to the concept "The time Joe didn't have enough credit last Thursday"), which can be useful for support or forensic purposes.

さらに、問題の詳細には、問題の特定の発生を識別するURI( "Joeに先週の木曜日に十分なクレジットがなかった時間"の識別子を効果的に与える)など、サポートに役立つ他の情報を含めることができます。または法医学目的。

The data model for problem details is a JSON [RFC7159] object; when formatted as a JSON document, it uses the "application/problem+json" media type. Appendix A defines how to express them in an equivalent XML format, which uses the "application/problem+xml" media type.

問題の詳細のデータモデルはJSON [RFC7159]オブジェクトです。 JSONドキュメントとしてフォーマットされている場合、「application / problem + json」メディアタイプを使用します。付録Aでは、「application / problem + xml」メディアタイプを使用する同等のXML形式でそれらを表現する方法を定義しています。

Note that problem details are (naturally) not the only way to convey the details of a problem in HTTP; if the response is still a representation of a resource, for example, it's often preferable to accommodate describing the relevant details in that application's format. Likewise, in many situations, there is an appropriate HTTP status code that does not require extra detail to be conveyed.


Instead, the aim of this specification is to define common error formats for those applications that need one, so that they aren't required to define their own, or worse, tempted to redefine the semantics of existing HTTP status codes. Even if an application chooses not to use it to convey errors, reviewing its design can help guide the design decisions faced when conveying errors in an existing format.


2. Requirements
2. 必要条件

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

このドキュメントのキーワード「MUST」、「MUST NOT」、「REQUIRED」、「SHALL」、「SHALL NOT」、「SHOULD」、「SHOULD NOT」、「RECOMMENDED」、「MAY」、および「OPTIONAL」は、 [RFC2119]で説明されているように解釈されます。

3. The Problem Details JSON Object
3. 問題の詳細JSONオブジェクト

The canonical model for problem details is a JSON [RFC7159] object.

問題の詳細の正規モデルは、JSON [RFC7159]オブジェクトです。

When serialized as a JSON document, that format is identified with the "application/problem+json" media type.

JSONドキュメントとしてシリアル化される場合、そのフォーマットは「application / problem + json」メディアタイプで識別されます。

For example, an HTTP response carrying JSON problem details:


   HTTP/1.1 403 Forbidden
   Content-Type: application/problem+json
   Content-Language: en
    "type": "",
    "title": "You do not have enough credit.",
    "detail": "Your current balance is 30, but that costs 50.",
    "instance": "/account/12345/msgs/abc",
    "balance": 30,
    "accounts": ["/account/12345",

Here, the out-of-credit problem (identified by its type URI) indicates the reason for the 403 in "title", gives a reference for the specific problem occurrence with "instance", gives occurrence-specific details in "detail", and adds two extensions; "balance" conveys the account's balance, and "accounts" gives links where the account can be topped up.

ここで、信用できない問題(そのタイプURIで識別)は、「タイトル」の403の理由を示し、「インスタンス」で特定の問題の発生を参照し、「詳細」で発生固有の詳細を示します。 2つの拡張機能を追加します。 「残高」はアカウントの残高を表し、「アカウント」はアカウントにチャージできるリンクを提供します。

The ability to convey problem-specific extensions allows more than one problem to be conveyed. For example:


   HTTP/1.1 400 Bad Request
   Content-Type: application/problem+json
   Content-Language: en
   "type": "",
   "title": "Your request parameters didn't validate.",
   "invalid-params": [ {
                         "name": "age",
                         "reason": "must be a positive integer"
                         "name": "color",
                         "reason": "must be 'green', 'red' or 'blue'"}

Note that this requires each of the subproblems to be similar enough to use the same HTTP status code. If they do not, the 207 (Multi-Status) [RFC4918] code could be used to encapsulate multiple status messages.


3.1. Members of a Problem Details Object
3.1. 問題詳細オブジェクトのメンバー

A problem details object can have the following members:


o "type" (string) - A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be "about:blank".

o "type"(文字列)-問題のタイプを識別するURI参照[RFC3986]。この仕様では、逆参照すると、問題の種類について人間が読める形式のドキュメントが提供されるようになります(たとえば、HTML [W3C.REC-html5-20141028]を使用)。このメンバーが存在しない場合、その値は "about:blank"であると見なされます。

o "title" (string) - A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).

o "タイトル"(文字列)-人間が読める形式の問題タイプの概要。ローカリゼーションの目的を除いて、問題の発生ごとに変更するべきではありません(たとえば、事前対応型のコンテンツネゴシエーションを使用します。[RFC7231]、セクション3.4を参照)。

o "status" (number) - The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.

o "status"(number)-この問題の発生に対してオリジンサーバーによって生成されたHTTPステータスコード([RFC7231]、セクション6)。

o "detail" (string) - A human-readable explanation specific to this occurrence of the problem.

o "detail"(文字列)-この問題の発生に固有の、人間が読める説明。

o "instance" (string) - A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.

o 「インスタンス」(文字列)-問題の特定の発生を識別するURI参照。逆参照すると、詳細情報が得られる場合と得られない場合があります。

Consumers MUST use the "type" string as the primary identifier for the problem type; the "title" string is advisory and included only for users who are not aware of the semantics of the URI and do not have the ability to discover them (e.g., offline log analysis). Consumers SHOULD NOT automatically dereference the type URI.

消費者は、問題のタイプの主要な識別子として「タイプ」文字列を使用する必要があります。 「タイトル」文字列は参考情報であり、URIのセマンティクスを認識しておらず、それらを検出する機能がないユーザー(オフラインログ分析など)にのみ含まれます。コンシューマはタイプURIを自動的に逆参照しないでください。

The "status" member, if present, is only advisory; it conveys the HTTP status code used for the convenience of the consumer. Generators MUST use the same status code in the actual HTTP response, to assure that generic HTTP software that does not understand this format still behaves correctly. See Section 5 for further caveats regarding its use.


Consumers can use the status member to determine what the original status code used by the generator was, in cases where it has been changed (e.g., by an intermediary or cache), and when message bodies persist without HTTP information. Generic HTTP software will still use the HTTP status code.


The "detail" member, if present, ought to focus on helping the client correct the problem, rather than giving debugging information.


Consumers SHOULD NOT parse the "detail" member for information; extensions are more suitable and less error-prone ways to obtain such information.


Note that both "type" and "instance" accept relative URIs; this means that they must be resolved relative to the document's base URI, as per [RFC3986], Section 5.


3.2. Extension Members
3.2. 拡張メンバー

Problem type definitions MAY extend the problem details object with additional members.


For example, our "out of credit" problem above defines two such extensions -- "balance" and "accounts" to convey additional, problem-specific information.


Clients consuming problem details MUST ignore any such extensions that they don't recognize; this allows problem types to evolve and include additional information in the future.


Note that because extensions are effectively put into a namespace by the problem type, it is not possible to define new "standard" members without defining a new media type.


4. Defining New Problem Types
4. 新しい問題タイプの定義

When an HTTP API needs to define a response that indicates an error condition, it might be appropriate to do so by defining a new problem type.

HTTP APIがエラー状態を示す応答を定義する必要がある場合は、新しい問題タイプを定義することでそれを行うことが適切な場合があります。

Before doing so, it's important to understand what they are good for, and what's better left to other mechanisms.


Problem details are not a debugging tool for the underlying implementation; rather, they are a way to expose greater detail about the HTTP interface itself. Designers of new problem types need to carefully consider the Security Considerations (Section 5), in particular, the risk of exposing attack vectors by exposing implementation internals through error messages.


Likewise, truly generic problems -- i.e., conditions that could potentially apply to any resource on the Web -- are usually better expressed as plain status codes. For example, a "write access disallowed" problem is probably unnecessary, since a 403 Forbidden status code in response to a PUT request is self-explanatory.

同様に、真に一般的な問題-つまり、Web上の任意のリソースに潜在的に適用される可能性のある状態-は、通常、単純なステータスコードとして表現されます。たとえば、PUTリクエストに対する403 Forbiddenステータスコードは説明不要であるため、「書き込みアクセスが許可されていません」という問題はおそらく不要です。

Finally, an application might have a more appropriate way to carry an error in a format that it already defines. Problem details are intended to avoid the necessity of establishing new "fault" or "error" document formats, not to replace existing domain-specific formats.


That said, it is possible to add support for problem details to existing HTTP APIs using HTTP content negotiation (e.g., using the Accept request header to indicate a preference for this format; see [RFC7231], Section 5.3.2).

とはいえ、HTTPコンテンツネゴシエーションを使用して既存のHTTP APIに問題の詳細のサポートを追加することは可能です(たとえば、Acceptリクエストヘッダーを使用してこの形式の設定を示します。[RFC7231]のセクション5.3.2を参照してください)。

New problem type definitions MUST document:


1. a type URI (typically, with the "http" or "https" scheme),

1. タイプURI(通常、「http」または「https」スキームを使用)、

2. a title that appropriately describes it (think short), and

2. それを適切に説明するタイトル(短く考える)、および

3. the HTTP status code for it to be used with.

3. 使用するHTTPステータスコード。

Problem type definitions MAY specify the use of the Retry-After response header ([RFC7231], Section 7.1.3) in appropriate circumstances.


A problem's type URI SHOULD resolve to HTML [W3C.REC-html5-20141028] documentation that explains how to resolve the problem.

問題のタイプURIは、問題の解決方法を説明するHTML [W3C.REC-html5-20141028]ドキュメントに解決する必要があります(SHOULD)。

A problem type definition MAY specify additional members on the problem details object. For example, an extension might use typed links [RFC5988] to another resource that can be used by machines to resolve the problem.


If such additional members are defined, their names SHOULD start with a letter (ALPHA, as per [RFC5234], Appendix B.1) and SHOULD consist of characters from ALPHA, DIGIT ([RFC5234], Appendix B.1), and "_" (so that it can be serialized in formats other than JSON), and they SHOULD be three characters or longer.

そのような追加のメンバーが定義されている場合、その名前は文字(ALPHA、[RFC5234]、付録B.1に従って)で始まり(SHOULD)、ALPHA、DIGIT([RFC5234]、付録B.1)、および「 _ "(JSON以外の形式でシリアル化できるようにするため)および3文字以上である必要があります(SHOULD)。

4.1. Example
4.1. 例

For example, if you are publishing an HTTP API to your online shopping cart, you might need to indicate that the user is out of credit (our example from above), and therefore cannot make the purchase.

たとえば、HTTP APIをオンラインショッピングカートに公開している場合、ユーザーにクレジットがない(上記の例)ため、購入できないことを示す必要がある場合があります。

If you already have an application-specific format that can accommodate this information, it's probably best to do that. However, if you don't, you might consider using one of the problem details formats -- JSON if your API is JSON-based, or XML if it uses that format.


To do so, you might look for an already-defined type URI that suits your purposes. If one is available, you can reuse that URI.


If one isn't available, you could mint and document a new type URI (which ought to be under your control and stable over time), an appropriate title and the HTTP status code that it will be used with, along with what it means and how it should be handled.


In summary: an instance URI will always identify a specific occurrence of a problem. On the other hand, type URIs can be reused if an appropriate description of a problem type is already available someplace else, or they can be created for new problem types.


4.2. Predefined Problem Types
4.2. 定義済みの問題タイプ

This specification reserves the use of one URI as a problem type:


The "about:blank" URI [RFC6694], when used as a problem type, indicates that the problem has no additional semantics beyond that of the HTTP status code.

「about:blank」URI [RFC6694]を問題タイプとして使用すると、問題にはHTTPステータスコード以外のセマンティクスがないことが示されます。

When "about:blank" is used, the title SHOULD be the same as the recommended HTTP status phrase for that code (e.g., "Not Found" for 404, and so on), although it MAY be localized to suit client preferences (expressed with the Accept-Language request header).

「about:blank」を使用する場合、タイトルはそのコードに推奨されるHTTPステータスフレーズと同じである必要があります(たとえば、404の「Not Found」など)。 Accept-Languageリクエストヘッダーを使用)。

Please note that according to how the "type" member is defined (Section 3.1), the "about:blank" URI is the default value for that member. Consequently, any problem details object not carrying an explicit "type" member implicitly uses this URI.


5. Security Considerations
5. セキュリティに関する考慮事項

When defining a new problem type, the information included must be carefully vetted. Likewise, when actually generating a problem -- however it is serialized -- the details given must also be scrutinized.


Risks include leaking information that can be exploited to compromise the system, access to the system, or the privacy of users of the system.


Generators providing links to occurrence information are encouraged to avoid making implementation details such as a stack dump available through the HTTP interface, since this can expose sensitive details of the server implementation, its data, and so on.


The "status" member duplicates the information available in the HTTP status code itself, thereby bringing the possibility of disagreement between the two. Their relative precedence is not clear, since a disagreement might indicate that (for example) an intermediary has modified the HTTP status code in transit (e.g., by a proxy or cache).


As such, those defining problem types as well as generators and consumers of problems need to be aware that generic software (such as proxies, load balancers, firewalls, and virus scanners) are unlikely to know of or respect the status code conveyed in this member.


6. IANA Considerations
6. IANAに関する考慮事項

This specification defines two new Internet media types [RFC6838].


6.1. application/problem+json
6.1. application / problem + json

Type name: application


Subtype name: problem+json

サブタイプ名:problem + json

Required parameters: None


Optional parameters: None; unrecognized parameters should be ignored


Encoding considerations: Same as [RFC7159]


Security considerations: see Section 5 of this document


Interoperability considerations: None


Published specification: RFC 7807 (this document)

公開された仕様:RFC 7807(このドキュメント)

Applications that use this media type: HTTP


Fragment identifier considerations: Same as for application/json ([RFC7159])

フラグメント識別子の考慮事項:application / json([RFC7159])と同じ

Additional information:


Deprecated alias names for this type: n/a

このタイプの非推奨のエイリアス名:n / a

      Magic number(s):  n/a
      File extension(s):  n/a
      Macintosh file type code(s):  n/a
   Person and email address to contact for further information:
      Mark Nottingham <>

Intended usage: COMMON


Restrictions on usage: None.


   Author:  Mark Nottingham <>

Change controller: IESG


6.2. application/problem+xml
6.2. application / problem + xml

Type name: application


Subtype name: problem+xml

サブタイプ名:problem + xml

Required parameters: None


Optional parameters: None; unrecognized parameters should be ignored


Encoding considerations: Same as [RFC7303]


Security considerations: see Section 5 of this document


Interoperability considerations: None


Published specification: RFC 7807 (this document)

公開された仕様:RFC 7807(このドキュメント)

Applications that use this media type: HTTP


Fragment identifier considerations: Same as for application/xml (as specified by Section 5 of [RFC7303])

フラグメント識別子の考慮事項:application / xmlと同じ([RFC7303]のセクション5で指定)

Additional information:


Deprecated alias names for this type: n/a

このタイプの非推奨のエイリアス名:n / a

      Magic number(s):  n/a
      File extension(s):  n/a
      Macintosh file type code(s):  n/a
   Person and email address to contact for further information:
      Mark Nottingham <>

Intended usage: COMMON


Restrictions on usage: None.


   Author:  Mark Nottingham <>

Change controller: IESG


7. References
7. 参考文献
7.1. Normative References
7.1. 引用文献

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <>.

[RFC2119] Bradner、S。、「要件レベルを示すためにRFCで使用するキーワード」、BCP 14、RFC 2119、DOI 10.17487 / RFC2119、1997年3月、< rfc2119>。

[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005, <>.

[RFC3986] Berners-Lee、T.、Fielding、R。、およびL. Masinter、「Uniform Resource Identifier(URI):Generic Syntax」、STD 66、RFC 3986、DOI 10.17487 / RFC3986、2005年1月、<http:/ />。

[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, January 2008, <>.

[RFC5234]クロッカー、D。、エド。およびP. Overell、「構文仕様の拡張BNF:ABNF」、STD 68、RFC 5234、DOI 10.17487 / RFC5234、2008年1月、<>。

[RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 2014, <>.

[RFC7159]ブレイ、T。、編、「JavaScriptオブジェクト表記(JSON)データ交換フォーマット」、RFC 7159、DOI 10.17487 / RFC7159、2014年3月、< rfc7159>。

[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014, <>.

[RFC7230]フィールディング、R。、エド。およびJ. Reschke編、「Hypertext Transfer Protocol(HTTP / 1.1):Message Syntax and Routing」、RFC 7230、DOI 10.17487 / RFC7230、2014年6月、< rfc7230>。

[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, DOI 10.17487/RFC7231, June 2014, <>.

[RFC7231]フィールディング、R。、エド。およびJ. Reschke編、「Hypertext Transfer Protocol(HTTP / 1.1):Semantics and Content」、RFC 7231、DOI 10.17487 / RFC7231、2014年6月、< >。

[W3C.REC-xml-20081126] Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", W3C Recommendation REC-xml-20081126, November 2008, <>.

[W3C.REC-xml-20081126]ブレイ、T。、パオリ、J.、Sperberg-McQueen、M。、マラー、E。、およびF.イェルガウ、「Extensible Markup Language(XML)1.0(Fifth Edition)」、 W3C勧告REC-xml-20081126、2008年11月、<>。

7.2. Informative References
7.2. 参考引用
              International Organization for Standardization,
              "Information Technology --- Document Schema Definition
              Languages (DSDL) --- Part 2: Grammar-based Validation ---
              RELAX NG", ISO/IEC 19757-2, 2003.

[RFC4918] Dusseault, L., Ed., "HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)", RFC 4918, DOI 10.17487/RFC4918, June 2007, <>.

[RFC4918] Dusseault、L.、Ed。、「Web Distributed Authoring and Versioning(WebDAV)のHTTP拡張機能」、RFC 4918、DOI 10.17487 / RFC4918、2007年6月、< / rfc4918>。

[RFC5988] Nottingham, M., "Web Linking", RFC 5988, DOI 10.17487/RFC5988, October 2010, <>.

[RFC5988]ノッティンガム、M。、「Webリンク」、RFC 5988、DOI 10.17487 / RFC5988、2010年10月、<>。

[RFC6694] Moonesamy, S., Ed., "The "about" URI Scheme", RFC 6694, DOI 10.17487/RFC6694, August 2012, <>.

[RFC6694] Moonesamy、S.、Ed。、 "The" about "URI Scheme"、RFC 6694、DOI 10.17487 / RFC6694、August 2012、<>

[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type Specifications and Registration Procedures", BCP 13, RFC 6838, DOI 10.17487/RFC6838, January 2013, <>.

[RFC6838] Freed、N.、Klensin、J。、およびT. Hansen、「Media Type Specifications and Registration Procedures」、BCP 13、RFC 6838、DOI 10.17487 / RFC6838、2013年1月、<http://www.rfc->。

[RFC7303] Thompson, H. and C. Lilley, "XML Media Types", RFC 7303, DOI 10.17487/RFC7303, July 2014, <>.

[RFC7303] Thompson、H。およびC. Lilley、「XML Media Types」、RFC 7303、DOI 10.17487 / RFC7303、2014年7月、<>。

[W3C.REC-html5-20141028] Hickson, I., Berjon, R., Faulkner, S., Leithead, T., Navara, E., O'Connor, E., and S. Pfeiffer, "HTML5", W3C Recommendation REC-html5-20141028, October 2014, <>.

[W3C.REC-html5-20141028] Hickson、I.、Berjon、R.、Faulkner、S.、Width、T.、Navara、E.、O'Connor、E.、and S. Pfeiffer、 "HTML5"、 W3C勧告REC-html5-20141028、2014年10月、<>。

[W3C.REC-rdfa-core-20130822] Adida, B., Birbeck, M., McCarron, S., and I. Herman, "RDFa Core 1.1 - Second Edition", W3C Recommendation REC-rdfa-core-20130822, August 2013, <>.

[W3C.REC-rdfa-core-20130822] Adida、B.、Birbeck、M.、McCarron、S.、and I. Herman、 "RDFa Core 1.1-Second Edition"、W3C Recommendation REC-rdfa-core-20130822、 2013年8月、<>。

[W3C.REC-xml-stylesheet-20101028] Clark, J., Pieters, S., and H. Thompson, "Associating Style Sheets with XML documents 1.0 (Second Edition)", W3C Recommendation REC-xml-stylesheet-20101028, October 2010, <>.

[W3C.REC-xml-stylesheet-20101028]クラークJ.、ピーターズS.、およびH.トンプソン、「スタイルシートとXMLドキュメント1.0の関連付け(第2版)」、W3C勧告REC-xml-stylesheet-20101028、 2010年10月、<>。

Appendix A. HTTP Problems and XML
付録A. HTTPの問題とXML

Some HTTP-based APIs use XML [W3C.REC-xml-20081126] as their primary format convention. Such APIs can express problem details using the format defined in this appendix.

一部のHTTPベースのAPIは、主要な形式規則としてXML [W3C.REC-xml-20081126]を使用します。このようなAPIは、この付録で定義されている形式を使用して問題の詳細を表現できます。

The RELAX NG schema [ISO-19757-2] for the XML format is as follows. Keep in mind that this schema is only meant as documentation, and not as a normative schema that captures all constraints of the XML format. Also, it would be possible to use other XML schema languages to define a similar set of constraints (depending on the features of the chosen schema language).

XML形式のRELAX NGスキーマ[ISO-19757-2]は次のとおりです。このスキーマはドキュメントとしてのみ意図されており、XML形式のすべての制約を取り込む規範的なスキーマとしてではないことに注意してください。また、他のXMLスキーマ言語を使用して、同様の一連の制約を定義することもできます(選択したスキーマ言語の機能によって異なります)。

      default namespace ns = "urn:ietf:rfc:7807"

start = problem


      problem =
        element problem {
          (  element  type            { xsd:anyURI }?
           & element  title           { xsd:string }?
           & element  detail          { xsd:string }?
           & element  status          { xsd:positiveInteger }?
           & element  instance        { xsd:anyURI }? ),
      anyNsElement =
        (  element    ns:*  { anyNsElement | text }
         | attribute  *     { text })*

The media type for this format is "application/problem+xml".

この形式のメディアタイプは「application / problem + xml」です。

Extension arrays and objects are serialized into the XML format by considering an element containing a child or children to represent an object, except for elements that contain only child element(s) named 'i', which are considered arrays. For example, the example above appears in XML as follows: HTTP/1.1 403 Forbidden Content-Type: application/problem+xml Content-Language: en

配列と見なされる「i」という名前の子要素のみを含む要素を除いて、オブジェクトを表すために子を含む要素を考慮することにより、拡張配列とオブジェクトはXML形式にシリアル化されます。たとえば、上記の例はXMLで次のように表示されます。HTTP / 1.1 403 Forbidden Content-Type:application / problem + xml Content-Language:en

   <?xml version="1.0" encoding="UTF-8"?>
   <problem xmlns="urn:ietf:rfc:7807">
     <title>You do not have enough credit.</title>
     <detail>Your current balance is 30, but that costs 50.</detail>

Note that this format uses an XML namespace. This is primarily to allow embedding it into other XML-based formats; it does not imply that it can or should be extended with elements or attributes in other namespaces. The RELAX NG schema explicitly only allows elements from the one namespace used in the XML format. Any extension arrays and objects MUST be serialized into XML markup using only that namespace.

この形式はXML名前空間を使用することに注意してください。これは主に、それを他のXMLベースのフォーマットに埋め込むことができるようにするためです。他の名前空間の要素や属性で拡張できること、または拡張する必要があることを意味するものではありません。 RELAX NGスキーマは、XML形式で使用される1つの名前空間の要素のみを明示的に許可します。拡張配列とオブジェクトは、その名前空間のみを使用してXMLマークアップにシリアル化する必要があります。

When using the XML format, it is possible to embed an XML processing instruction in the XML that instructs clients to transform the XML, using the referenced XSLT code [W3C.REC-xml-stylesheet-20101028]. If this code is transforming the XML into (X)HTML, then it is possible to serve the XML format, and yet have clients capable of performing the transformation display human-friendly (X)HTML that is rendered and displayed at the client. Note that when using this method, it is advisable to use XSLT 1.0 in order to maximize the number of clients capable of executing the XSLT code.

XML形式を使用する場合、参照されているXSLTコード[W3C.REC-xml-stylesheet-20101028]を使用して、クライアントにXMLの変換を指示するXML処理命令をXMLに埋め込むことができます。このコードがXMLを(X)HTMLに変換する場合、XML形式を提供することは可能ですが、クライアントでレンダリングおよび表示される変換表示を実行できる(X)HTMLの変換を実行できるクライアントがあります。この方法を使用する場合は、XSLTコードを実行できるクライアントの数を最大化するために、XSLT 1.0を使用することをお勧めします。

Appendix B. Using Problem Details with Other Formats

In some situations, it can be advantageous to embed problem details in formats other than those described here. For example, an API that uses HTML [W3C.REC-html5-20141028] might want to also use HTML for expressing its problem details.

状況によっては、ここで説明する形式以外の形式で問題の詳細を埋め込むことが有利な場合があります。たとえば、HTML [W3C.REC-html5-20141028]を使用するAPIでは、問題の詳細を表現するためにHTMLも使用したい場合があります。

Problem details can be embedded in other formats either by encapsulating one of the existing serializations (JSON or XML) into that format or by translating the model of a problem detail (as specified in Section 3) into the format's conventions.


For example, in HTML, a problem could be embedded by encapsulating JSON in a script tag:


          <script type="application/problem+json">
             "type": "",
             "title": "You do not have enough credit.",
             "detail": "Your current balance is 30, but that costs 50.",
             "instance": "/account/12345/msgs/abc",
             "balance": 30,
             "accounts": ["/account/12345",

or by inventing a mapping into RDFa [W3C.REC-rdfa-core-20130822].


This specification does not make specific recommendations regarding embedding problem details in other formats; the appropriate way to embed them depends both upon the format in use and application of that format.




The authors would like to thank Jan Algermissen, Subbu Allamaraju, Mike Amundsen, Roy Fielding, Eran Hammer, Sam Johnston, Mike McCall, Julian Reschke, and James Snell for review of this specification.

この仕様のレビューについて、Jan Algermissen、Subbu Allamaraju、Mike Amundsen、Roy Fielding、Eran Hammer、Sam Johnston、Mike McCall、Julian Reschke、James Snellに感謝します。

Authors' Addresses


Mark Nottingham Akamai



Erik Wilde