How to auto-generate structs_impl.rs after modifying schema in local dev build?

Your question

Hi everyone,

I am a newcomer to the Stalwart codebase and am currently setting up a local development environment on my Mac (macOS).

I am trying to customize some schemas by adding new properties under stalwart/resources/schema/. The project builds successfully and the changes reflect well on the UI initially. However, when I try to save, I encounter an “Invalid property” error.

After digging into the code, I found out that the cause is crates/registry/src/schema/structs_impl.rs not being updated. It looks like a code-generated file.

Could anyone guide me on:

How to trigger the auto-generation for structs_impl.rs after updating the schema files? Is there a specific script (like Python or a cargo build script) that I should run?

If possible, could you provide a quick overview or best practices for setting up a full local dev workflow? (e.g., how to seed sample data, rebuild properly, and run the test suites?)

Any help or pointers to the right documentation would be greatly appreciated!

Thank you so much!

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

Let me look into the codebase to find how structs_impl.rs is generated.

Just wanted to add that I am truly passionate about Rust lang and have been diving deep into studying it recently. As part of my learning journey, I’m really keen on customizing and experimenting with Stalwart to better understand its architecture.

I would be incredibly grateful for any guidance, tips, or pointers you could share to help a fellow Rust enthusiast get on the right track!

Hi, the script that generates the structs from the documentation is not open source unfortunately as it is part of our internal CI pipeline. You can implement your own generator from the docs if you need to automate this.

Hi, Your explanation really helps me pinpoint the next steps and saves me a lot of time that would have otherwise been spent digging through the repository looking for the generator script.