Skip to content

fix: Change ValidationErrorDetail.input type from String to Object#507

Merged
edeandrea merged 1 commit into
docling-project:mainfrom
oscerd:fix/339
May 21, 2026
Merged

fix: Change ValidationErrorDetail.input type from String to Object#507
edeandrea merged 1 commit into
docling-project:mainfrom
oscerd:fix/339

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 21, 2026

Summary

  • Changed ValidationErrorDetail.input field type from String to Object to support both string and object values returned by docling-serve in 422 validation error responses
  • Added deserialization tests covering string input, object input, null input, and multiple error details

Context

docling-serve (Pydantic v2) returns the input field in 422 responses as either a JSON string (e.g., "file:///path") or a JSON object (e.g., {"kind": "file"}). The String type caused deserialization failures for object inputs. Using Object lets Jackson handle both shapes natively.

Fixes #339
Related: docling-project/docling-serve#493

Test plan

  • New unit tests for string, object, and null input deserialization
  • New unit tests for builder with string and object input
  • Existing integration tests pass (validation error tests with real docling-serve container)
  • Full build passes (./gradlew build)
  • Spotless formatting check passes

Generated with Claude Code

@oscerd oscerd changed the title Fix #339: Change ValidationErrorDetail.input type from String to Object fix: Change ValidationErrorDetail.input type from String to Object May 21, 2026
@github-actions
Copy link
Copy Markdown

:java_duke: JaCoCo coverage report

Overall Project 47.43% 🔴

There is no coverage information present for the Files changed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

TestsPassed ✅SkippedFailed
Gradle Test Results (all modules & JDKs)1020 ran1020 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

The docling-serve 422 validation error response can return the `input`
field as either a JSON string or a JSON object, depending on what failed
validation. Changing the field type from String to Object allows Jackson
to deserialize both shapes without a custom deserializer.

Fixes docling-project#339

Signed-off-by: Andrea Cosentino <ancosen1985@yahoo.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@github-actions
Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

@github-actions
Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

Copy link
Copy Markdown
Contributor

@edeandrea edeandrea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @oscerd !

@edeandrea edeandrea merged commit 6d65433 into docling-project:main May 21, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants