Skip to content

fix(upload): add required type and optional metadata to analyze input - #68

Merged
ericviana merged 1 commit into
mainfrom
eric/upload-analyze-input
Aug 4, 2026
Merged

ericviana merged 1 commit into
mainfrom
eric/upload-analyze-input

Conversation

@ericviana

Copy link
Copy Markdown
Member

Summary

  • UploadAnalyzeInput only declared file. The API's POST /v1/upload/analyze requires type (document kind enum) and accepts optional metadata. As typed, analyze() could never build a valid request.
  • Added UploadAnalyzeDocumentType Literal covering the spec's 21 enum values, made type required, and metadata optional (NotRequired[Optional[str]]).

Test plan

  • Added async/sync unit tests exercising analyze() with type and metadata
  • pytest, pyright, mypy, ruff all pass
  • .api-sync/sync.py --check and .api-sync/check_contract.py pass unchanged (this schema is a recorded exclusion in spec-map.json, unaffected by this fix)

Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs

UploadAnalyzeInput only declared `file`, so calling analyze() as typed
never sent the API's required `type` (document kind enum) and had no
way to pass the optional `metadata` verification hints.

Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs
@ericviana
ericviana merged commit 9f2acfe into main Aug 4, 2026
1 of 2 checks passed
@ericviana
ericviana deleted the eric/upload-analyze-input branch August 4, 2026 12:32
@BernardoSM

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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.

2 participants