ErrorModel

pydantic model safir.models.ErrorModel

A structured API error message.

Parameters:

data (Any)

Show JSON schema
{
   "title": "ErrorModel",
   "description": "A structured API error message.",
   "type": "object",
   "properties": {
      "detail": {
         "items": {
            "$ref": "#/$defs/ErrorDetail"
         },
         "title": "Detail",
         "type": "array"
      }
   },
   "$defs": {
      "ErrorDetail": {
         "description": "The detail of the error message.",
         "properties": {
            "loc": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "examples": [
                  [
                     "area",
                     "field"
                  ]
               ],
               "title": "Location"
            },
            "msg": {
               "examples": [
                  "Some error messge"
               ],
               "title": "Message",
               "type": "string"
            },
            "type": {
               "examples": [
                  "some_code"
               ],
               "title": "Error type",
               "type": "string"
            }
         },
         "required": [
            "msg",
            "type"
         ],
         "title": "ErrorDetail",
         "type": "object"
      }
   },
   "required": [
      "detail"
   ]
}

Fields:
field detail: list[ErrorDetail] [Required]