> Markdown version of [/videos/128-building-a-friendly-kotlin-sdk-to-connect-to-jetbrains-space?t=1642](https://www.wearedevelopers.com/videos/128-building-a-friendly-kotlin-sdk-to-connect-to-jetbrains-space?t=1642). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Building a Friendly Kotlin SDK to Connect to JetBrains Space Tired of fragile string templating and clunky OpenAPI generators? Learn how to build a strongly typed, ergonomic Kotlin SDK using API metadata and KotlinPoet. - **Speakers:** Maarten Balliauw - **Event:** WeAreDevelopers LIVE - **Published:** March 24, 2021 - **Duration:** 37:59 - **URL:** https://www.wearedevelopers.com/videos/128-building-a-friendly-kotlin-sdk-to-connect-to-jetbrains-space ## Summary JetBrains Space functions as an integrated team environment, unifying code repositories, issue tracking, continuous integration, and communication pipelines. Its extensibility relies on a massive HTTP API containing hundreds of evolving endpoints and object types. To support developers building custom integrations, JetBrains needed to provide language-specific SDKs. However, maintaining handcrafted wrappers or relying on generic OpenAPI generators resulted in tedious maintenance and a poor, unintuitive developer experience. To address this, the team exposed the Space API's underlying metadata model—including data transfer objects, enumerations, and URL parameters—to drive a custom code generation pipeline. Leveraging KotlinPoet, a model-based code generation library, they automatically produce syntactically safe, strongly typed Kotlin code. This approach prevents missing modifiers or invalid class names during the build process, offering significantly more reliability than basic string-templated code generation. The primary driver behind the auto-generated SDK is maximizing developer discoverability and minimizing configuration. By mapping the generated SDK structure exactly to the HTTP API Playground, developers can rely heavily on IDE auto-completion to explore available services. Instead of fragile string-based query parameters for partial data retrieval, the SDK utilizes type-safe Kotlin lambdas, ensuring typos are caught at compile time. To counteract the inherent verbosity of generated types—such as complex JSON payloads for chat messages—the SDK wraps auto-generated underlying structures with handwritten Domain-Specific Languages (DSLs) and factory methods. This hybrid approach ensures the SDK remains maintainable while offering an ergonomic, intuitive integration path. **Keywords:** jetbrains space integration, kotlin SDK generation, HTTP API discoverability, kotlinpoet code generation, model-based code generation, type-safe API responses, custom DSL creation, developer experience design, partial data retrieval, data transfer object mapping, API metadata extraction, IDE auto-completion optimization, compiled type checking, hybrid auto-generated code, strongly typed query parameters ## Chapters 1. **Introduction to JetBrains Space and integrated team environments** (00:19) — How an integrated team environment centralizes collaboration tools and developer resources. 1. **Exploring features and integrations within JetBrains Space** (02:15) — Connecting disparate team workflows through personalized dashboards, repository tracking, and integrated chat discussions. 1. **Discovering endpoints using the Space HTTP API playground** (08:18) — Testing endpoints and retrieving precise payload fields using the built-in HTTP API playground. 1. **Overcoming challenges with OpenAPI generators for custom SDKs** (13:50) — Addressing API endpoint churn and structural verbosity by building a custom generator alongside exposed metadata. 1. **Implementing the API client code generator for Kotlin** (20:32) — Ingesting server metadata to programmatically reconstruct accurate backend enumerations and data transfer objects in client code. 1. **Ensuring type safety and file formatting with KotlinPoet** (23:52) — Preventing invalid syntax and missing properties during code emission by integrating model-based Kotlin code generators. 1. **Enhancing developer experience with SDK discovery and DSLs** (27:22) — Simplifying complex payload initialization with readable helper methods, explicit completions, and domain-specific language abstractions. 1. **Live IDE demonstration of the generated Space SDK** (33:50) — Validating authentication steps and strongly typed network requests directly inside the local development environment. ## Related Moments - [Designing cross-platform APIs with team collaboration](https://www.wearedevelopers.com/videos/100143-the-dark-corners-of-kotlin-multiplatform) (from "The Dark Corners of Kotlin Multiplatform") - [Introduction to Kotlin history and Java ecosystem interoperability](https://www.wearedevelopers.com/videos/384-moving-from-java-to-kotlin) (from "Moving from Java to Kotlin") - [Introduction to Kotlin and Java interoperability](https://www.wearedevelopers.com/videos/512-route-from-java-to-kotlin) (from "Route from Java to Kotlin") - [Summarizing the practical engineering advantages of writing Kotlin](https://www.wearedevelopers.com/videos/661-why-kotlin-is-the-better-java-and-how-you-can-start-using-it) (from "Why Kotlin is the better Java and how you can start using it") - [Architecting shared modules for seamless frontend and backend integrations](https://www.wearedevelopers.com/videos/1184-location-verification-without-gps) (from "Location Verification without GPS?") - [Rethinking developer environments with conversational code assistance](https://www.wearedevelopers.com/videos/1332-google-gemini-open-source-and-deep-thinking-models-sam-witteveen) (from "Google Gemini: Open Source and Deep Thinking Models - Sam Witteveen") ## Related Articles - [Liuba Gonta and Yuliya Khadasevic - GitHub Copilot Beyond the Basics - 10 Ways to Elevate Your Coding](https://www.wearedevelopers.com/magazine/490-liuba-gonta-and-yuliya-khadasevic-github-copilot-beyond-the-basics-10-ways-to-elevate-your-coding) - [How we Build The Software of Tomorrow](https://www.wearedevelopers.com/magazine/120-how-we-build-the-software-of-tomorrow) - [Exploring AI: Opportunities and Risks for Developers](https://www.wearedevelopers.com/magazine/522-exploring-ai-opportunities-and-risks-for-developers) - [Dev Digest 132 - Binging WADFlix?](https://www.wearedevelopers.com/magazine/473-dev-digest-132-binging-wadflix) ## Related Jobs - [AI Software Engineer (Germany)](https://www.wearedevelopers.com/jobs/48317-ai-software-engineer-germany) at **Sunhat** - [Staff Software Engineer, Copilot Experiences](https://www.wearedevelopers.com/jobs/ext/164361-staff-software-engineer-copilot-experiences) at **GitHub** - [Senior Software Engineer, Android (Earn Experience)](https://www.wearedevelopers.com/jobs/ext/1937627-senior-software-engineer-android-earn-experience) at **Bitpanda** - [Data Engineer](https://www.wearedevelopers.com/jobs/ext/1276933-data-engineer) at **PROSOZ Herten GmbH** - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Senior Software Engineer (L3)](https://www.wearedevelopers.com/jobs/ext/1956800-senior-software-engineer-l3) at **Twilio**