ODataV4Format クラス

OData V4 エラー形式を記述するクラス。

http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091

JSON の例:

error: { "code": "ValidationError", "message": "1 つ以上のフィールドに正しくない値が含まれています: ", "details": [

  {
     "code": "ValidationError",
     "target": "representation",
     "message": "Parsing error(s): String '' does not match regex pattern '^[^{}/ :]+(?: :\d+)?$'.
     Path 'host', line 1, position 297."

  },
  {

     "code": "ValidationError",
     "target": "representation",
     "message": "Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate
     https: //github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
     (schema [https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json](https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json))."

  }

]

}

継承
builtins.object
ODataV4Format

コンストラクター

ODataV4Format(json_object: Mapping[str, Any])

パラメーター

json_object
dict
必須

ODataV4 JSON を表す Python ディクテーション

変数

~.code
str

その値は、サービス定義のエラー コードです。 このコードは、応答に指定された HTTP エラー コードのサブステータスとして機能します。

message
str

人間が判読できる言語に依存するエラー表現。

target
str

特定のエラーのターゲット (たとえば、エラーのプロパティの名前)。 このフィールドは省略可能で、None にすることができます。

details
list[ODataV4Format]

ODataV4Format インスタンスの配列。コードとメッセージの名前と値のペアが含まれている必要があり、前述のようにターゲットの名前と値のペアが含まれている場合があります。

innererror
dict

オブジェクト。 このオブジェクトの内容はサービス定義です。 通常、このオブジェクトには、サービスのデバッグに役立つ情報が含まれています。

メソッド

message_details

エラーの詳細な文字列を返します。

message_details

エラーの詳細な文字列を返します。

message_details() -> str

戻り値

エラーの詳細を含む文字列。

の戻り値の型 :

str

属性

error

CODE_LABEL

CODE_LABEL = 'code'

DETAILS_LABEL

DETAILS_LABEL = 'details'

INNERERROR_LABEL

INNERERROR_LABEL = 'innererror'

MESSAGE_LABEL

MESSAGE_LABEL = 'message'

TARGET_LABEL

TARGET_LABEL = 'target'