Skip to content

Add a serde tag to ParsedItem - #2546

Merged
gpeal merged 1 commit into
mainfrom
gpeal/tag-parsed-item
Aug 21, 2025
Merged

gpeal merged 1 commit into
mainfrom
gpeal/tag-parsed-item

Conversation

@gpeal

@gpeal gpeal commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines 4 to 6
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ParsedCommand {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P1] Change ParsedCommand serialization format without versioning

Adding #[serde(tag="type", rename_all="snake_case")] in parse_command.rs (lines 4‑6) switches the enum from externally tagged to internally tagged. Any clients or stored logs expecting the old shape such as { "Read": {...} } will now fail to parse { "type": "read", ... }. No versioning or migration exists to manage this protocol break.

Useful? React with 👍 / 👎.

@bolinfest bolinfest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not that it seems to matter much in this case, but I think we should move to camelCase where it makes sense?

@gpeal

gpeal commented Aug 21, 2025

Copy link
Copy Markdown
Contributor Author

Not that it seems to matter much in this case, but I think we should move to camelCase where it makes sense?

Yeah, we should talk through conventions. In this case, I think snake case makes sense for a type tag in a discriminated union but we should strive for consistency (even if the convention is camelCase sometimes and snake_case sometimes) as long as the rules are clear

@gpeal
gpeal merged commit 74683ba into main Aug 21, 2025
@gpeal
gpeal deleted the gpeal/tag-parsed-item branch August 21, 2025 05:34
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants