Building and generating a .NET client for a large API
summary
The Space HTTP API surface is massive — about 170 endpoints and more than 700 DTOs — so a generator reads the server’s API model (JSON), emits C# via string-builder templates and extension helpers, and targets System.Text.Json with custom converters for enums and polymorphism. The result is a generated .NET SDK with flattened request signatures, factory helpers, IAsyncEnumerable paging, and property-not-requested exceptions; code lives on GitHub and works, while a .NET 5 source-generator variant works too but needs a better trigger to regenerate on demand.
AI-written summary · about
chapters (15)
- 0:00Introduction and welcome
- 3:03What is JetBrains Space
- 7:13Space API challenges and opportunities
- 17:03Why manual SDKs don't scale
- 20:37Exposing the API model
- 27:17Generating enums in .NET
- 30:29Code generation approaches
- 32:13System.Text.Json limitations
- 34:01Custom JSON converters
- 38:53Developer experience focus
- 47:01Batching and async enumerables
- 51:37Flattening request bodies
- 55:54Factory methods and defaults
- 56:36ASP.NET Core integration
- 58:22Conclusion and Q&A
