Skip to content

Conversation

@knjiang
Copy link
Contributor

@knjiang knjiang commented Jan 25, 2026

The google protobuf types are generated as prost structs which don't map to JSON directly.

This PR fixes google generated types by getting rid of the handwritten serde types in detect.rs and using pbjson to generate serde impls.

@knjiang knjiang changed the title fix google generated types Fix google generated types Jan 25, 2026
Copy link
Contributor Author

knjiang commented Jan 25, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@knjiang knjiang marked this pull request as ready for review January 25, 2026 05:15
@knjiang knjiang force-pushed the 01-25-fix_google_generated_types branch 2 times, most recently from 9b5554b to 1532447 Compare January 25, 2026 06:55
@knjiang knjiang force-pushed the 01-25-fix_google_generated_types branch from 1532447 to feb3b52 Compare January 25, 2026 17:34
Comment on lines -9 to +7
use lingua::serde_json;
use big_serde_json as serde_json;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

importing from big_serde_json instead of lingua to avoid cylical dep

Comment on lines -24 to -29
/// Lightweight serde struct for Google GenerateContent request validation.
///
/// This mirrors the structure of Google's protobuf GenerateContentRequest
/// but uses serde for JSON deserialization.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted types now that we use generated_pbjson.rs

@knjiang knjiang requested a review from ankrgyl January 25, 2026 17:59
@knjiang knjiang changed the title Fix google generated types Add serde serialization to google generated types Jan 25, 2026
Copy link
Contributor

@ankrgyl ankrgyl left a comment

Choose a reason for hiding this comment

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

looks fine (although to be honest, i only looked at the two place you commented)

@knjiang knjiang merged commit 321120f into main Jan 25, 2026
5 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.

3 participants