Aracılığıyla paylaş


ODataV4Format Sınıf

OData V4 hata biçimini açıklayan sınıf.

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

JSON örneği:

error: { "code": "ValidationError", "message": "Bir veya daha fazla alan yanlış değerler içeriyor: ", "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))."

  }

]

}

Devralma
builtins.object
ODataV4Format

Oluşturucu

ODataV4Format(json_object: Mapping[str, Any])

Parametreler

json_object
dict
Gerekli

ODataV4 JSON'u temsil eden python diktesi

Değişkenler

~.code
str

Değeri hizmet tanımlı bir hata kodudur. Bu kod, yanıtta belirtilen HTTP hata kodu için bir alt durum görevi görür.

message
str

Hatanın insan tarafından okunabilir, dile bağımlı gösterimi.

target
str

Belirli bir hatanın hedefi (örneğin, hatadaki özelliğin adı). Bu alan isteğe bağlıdır ve Hiçbiri olabilir.

details
list[ODataV4Format]

Kod ve ileti için ad/değer çiftleri IÇERMESİ GEREKEN ve yukarıda açıklandığı gibi hedef için bir ad/değer çifti içerebilen ODataV4Format örnekleri dizisi.

innererror
dict

Bir nesne. Bu nesnenin içeriği hizmet tanımlıdır. Bu nesne genellikle hizmette hata ayıklamaya yardımcı olacak bilgiler içerir.

Yöntemler

message_details

Hatanın ayrıntılı dizesini döndürür.

message_details

Hatanın ayrıntılı dizesini döndürür.

message_details() -> str

Döndürülenler

Hatanın ayrıntılarını içeren bir dize.

Dönüş türü

str

Öznitelikler

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'