-
Notifications
You must be signed in to change notification settings - Fork 0
Add serde serialization to google generated types #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9b5554b to
1532447
Compare
1532447 to
feb3b52
Compare
| use lingua::serde_json; | ||
| use big_serde_json as serde_json; |
There was a problem hiding this comment.
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
| /// 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")] |
There was a problem hiding this comment.
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
ankrgyl
left a comment
There was a problem hiding this 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)

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.rsand using pbjson to generate serde impls.