Skip to content

Validation error response (422) isn't whats in OpenAPI document #493

@edeandrea

Description

@edeandrea

The ValidationError type in the OpenAPI document:

{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

isn't what actually comes back from docling-serve (at least with v1.10.0):

{
  "detail" : [ {
    "type" : "missing",
    "loc" : [ "body", "sources", 0, "file", "base64_string" ],
    "msg" : "Field required",
    "input" : {
      "kind" : "file"
    }
  }, {
    "type" : "missing",
    "loc" : [ "body", "sources", 0, "file", "filename" ],
    "msg" : "Field required",
    "input" : {
      "kind" : "file"
    }
  } ]
}

The input field isn't documented. I think it used to be, but was documented as a string and now its an object, which is breaking my deserialization. My current workaround is to completely ignore the input field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions