Skip to content

feat: enable serde derivations for all generated types #7

@MrBT-nano

Description

@MrBT-nano

Request: Enable Serde Derivations in vtuber-contracts

To support vtuber-commons (which needs to deserialize configurations from TOML/JSON/YAML into typed structs), we need the generated Rust code in vtuber-contracts to include serde::Serialize and serde::Deserialize derivations.

Proposed Change

Update build.rs in vtuber-contracts to include type attributes for all generated messages:

tonic_build::configure()
    .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
    .compile_protos(protos, &["proto"])?;

And add serde as a dependency in vtuber-contracts/Cargo.toml.

Impact

This will allow every downstream service to easily convert between Protobuf messages and other data formats (JSON, TOML, YAML) used for persistent configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions