rig icon indicating copy to clipboard operation
rig copied to clipboard

feat: uniformize Serde enum tagging

Open Sytten opened this issue 5 months ago • 2 comments

  • [x] I have looked for existing issues (including closed) about this

Feature Request

Enum serialization is a bit all over the place, UserContent is inner tag (#[serde(tag = "type", rename_all = "lowercase")]) but AssistantContent is untagged (#[serde(untagged)]). I would suggest picking a pattern, I usually prefer to be more explicit than not (with an inner tag). Untagged will only get you so far.

Motivation

This is follow-up on #608, since I started looking at storing that data longer term. I have decided to create my own set of structs to have more control, but I would still suggest improving the tagging of enum so it is at least consistent.

Proposal

Apply an inner tag on all enums.

Sytten avatar Jul 24 '25 17:07 Sytten

related: #598

joshua-mo-143 avatar Sep 10 '25 22:09 joshua-mo-143