Skip to content

refactor: align crates/jina with OpenAPI specs#3943

Merged
yujonglee merged 2 commits intomainfrom
devin/1770973882-jina-openapi-refactor
Feb 13, 2026
Merged

refactor: align crates/jina with OpenAPI specs#3943
yujonglee merged 2 commits intomainfrom
devin/1770973882-jina-openapi-refactor

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 13, 2026

refactor: align crates/jina with OpenAPI specs

Summary

Refactors crates/jina to align with the Jina Reader (r.jina.ai) and Search (s.jina.ai) OpenAPI specs:

  • reader.rs: Expanded ReadUrlRequest with CrawlerOptions fields from the OpenAPI spec (no_cache, target_selector, remove_selector, token_budget, respond_with, retain_images, etc.). Switched from GET r.jina.ai/{url} with Accept: text/plain to POST r.jina.ai/ with Accept: application/json and JSON body, parsing a typed ReaderResponseEnvelope and returning data.content.
  • search.rs (new): Added SearchRequest and JinaClient::search() for the s.jina.ai Search API with key parameters (q, type, num, engine, gl, hl, page, site, etc.). Returns Vec<SearchResultItem>.
  • types.rs (new): Typed response envelopes (ReaderResponseEnvelope, SearchResponseEnvelope), data structs (ReaderData, SearchResultItem), and enums (RespondWith, RetainImages, SearchType, SearchEngine) from OpenAPI.
  • client.rs: Changed default Accept header from text/plain to application/json, added Content-Type: application/json.
  • Cargo.toml: Enabled reqwest json feature.

api-research (the only consumer) compiles without changes since read_url still returns String and ReadUrlRequest still has url: String as required with all new fields as Option.

Review & Testing Checklist for Human

  • Verify the GET→POST + text→JSON switch works with the real Jina API. This is the highest-risk change — read_url now POSTs JSON and parses a ReaderResponseEnvelope instead of reading raw text from a GET. All tests are #[ignore]'d so this is completely untested against the real API.
  • Verify ReaderData and SearchResultItem field names match the actual API response. These structs (title, url, content, description) are based on documented behavior, not empirical testing. If the real response uses different field names or nesting, deserialization will silently default to empty strings (due to #[serde(default)]) or fail outright.
  • Verify enum completeness against OpenAPI. Some variants are intentionally omitted: RespondWith is missing content, vlm, readerlm-v2; RetainImages is missing all_p, alt_p; SearchEngine is missing reader. If these are sent in a response, serde will error. Decide if they should be added.
  • Confirm the MCP tool schema change is desired. ReadUrlRequest now exposes 13 optional parameters to the MCP LLM tool schema (via schemars), which changes the tool interface in api-research.

Notes

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@netlify
Copy link

netlify bot commented Feb 13, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 21e0fe8
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/698efbad799f830008b7e68a

@netlify
Copy link

netlify bot commented Feb 13, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 21e0fe8
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/698efbadca785b00089a597e

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

View 7 additional findings in Devin Review.

Open in Devin Review

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@yujonglee yujonglee merged commit 4433174 into main Feb 13, 2026
19 of 20 checks passed
@yujonglee yujonglee deleted the devin/1770973882-jina-openapi-refactor branch February 13, 2026 10:36
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.

1 participant