Alpha state. A platform designed for building enterprise-grade, multi-tenant products using Azure, .NET, React, TypeScript, Infrastructure as Code, etc.
Update REST endpoints to support sending and receiving strongly typed IDs as strings in JSON request bodies and responses. Previously, strongly typed IDs were only supported on endpoint routes, like group.MapGet("/{id}", (UserId id) => { });.
In JSON request and response bodies, they were sent in an object format:
With this update, strongly typed IDs can now be represented as simple strings in JSON:
"id": "usr_01JBQ59BD2SMRX0HQN7FTJM7F8"
This change enables full compatibility with the OpenAPI JSON-to-TypeScript converter, which already supports strongly typed IDs, achieving strong typing throughout the entire application.
Checklist
[x] I have added a Label to the pull-request
[x] I have added tests, and done manual regression tests
[x] I have updated the documentation, if necessary
Summary & Motivation
Update REST endpoints to support sending and receiving strongly typed IDs as strings in JSON request bodies and responses. Previously, strongly typed IDs were only supported on endpoint routes, like
group.MapGet("/{id}", (UserId id) => { });
.In JSON request and response bodies, they were sent in an object format:
With this update, strongly typed IDs can now be represented as simple strings in JSON:
This change enables full compatibility with the OpenAPI JSON-to-TypeScript converter, which already supports strongly typed IDs, achieving strong typing throughout the entire application.
Checklist