Just an idea I had to share contracts defined in .NET with other languages, rust in this case. Quite similar to how OpenAPI/Swagger generated clients work.
Building the rust project with cargo will:
- Build the .NET contracts generator project (which produces the JSON schema files from the contracts project)
- Link the generated JSON schema files into its own local copy
- Generate a rust struct using schemafy
- Get some user input, and then print out the JSON of the hydrated DTO