Home / Companies / Speakeasy / Blog / Post Details
Content Deep Dive

Forward compatible SDKs: strict in development, lax in production

Blog post from Speakeasy

Post Details
Company
Date Published
Author
Thomas Rooney
Word Count
2,301
Language
English
Hacker News Points
-
Summary

In a rapidly evolving API landscape, the article discusses a strategy employed by Speakeasy for managing SDKs to balance strict validation during development and flexibility in production. This approach, inspired by Postel’s Law, involves implementing strict validation in controlled environments like CI pipelines to catch schema drift and contract violations early, while adopting a more permissive lax mode for external SDKs to ensure forward compatibility and prevent customer applications from crashing. By doing so, unknown values are preserved rather than causing errors, which allows for graceful degradation when APIs introduce new values or union types. This method not only aids in faster feature shipping and reduces support issues but also enhances the overall developer experience by maintaining a robust type system without sacrificing runtime adaptability. Speakeasy's implementation of this model with TypeScript SDKs demonstrates a pragmatic solution to the challenges of API evolution, ensuring that customers experience fewer disruptions while also benefiting from strong type safety and forward compatibility.