Repository navigation
fix(domain): let JSON options omit individual fields - #2
Draft
autoantohaki wants to merge 1 commit into
Draft
autoantohaki wants to merge 1 commit into
autoantohaki wants to merge 1 commit into
Conversation
The OpenAPI document and the MCP JSON schemas declare every field of
options as optional, but OcrOptions only had a default for the whole
object. A request such as {"options":{"include_words":false}} was
rejected as invalid_request because language and minimum_confidence were
missing. Apply the existing Default impl per field.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by mau
Before:
POST /v1/ocr(and batch items and the MCPocr_recognizeandocr_batcharguments) rejected a partialoptionsobject, for example{"options":{"include_words":false}}, with400 invalid_request. Onlyoptionsas a whole had a serde default, solanguageandminimum_confidencewere required wheneveroptionswas present. The OpenAPI document and both MCP JSON schemas declare all three fields optional.After: omitted option fields take the existing
OcrOptions::default()values (english,include_words: true,minimum_confidence: 0), as the schemas describe. Requests that send all fields behave as before.How: add a container-level
#[serde(default)]toOcrOptions, plus an HTTP test that sends{}, each field on its own, and checks both the 200 status and whether words are included.Note: this PR changes
.rssources, so the Windows runtime qualification attestation has to be re-recorded beforeverify-runtime-qualification-attestation.ps1passes.