Making Java nullable fields backwards compatible
Blog post from Stainless
Stainless focuses on creating SDKs that maintain forward compatibility with evolving APIs, ensuring that non-breaking API changes do not become breaking changes in SDKs. This challenge is illustrated through an example involving a Java SDK for a Pet Store API, where a change was made to make a parameter optional, leading to issues with Java's primitive conversions and binary compatibility. The change from a primitive long to a boxed Long caused problems with automatic type conversion and compatibility with previously compiled libraries. The solution involved preserving the original method signature while introducing a new method to handle the boxed type, ensuring both source and binary compatibility. This approach allows for seamless integration of new features without disrupting existing functionality. Stainless prides itself on meticulous attention to such details, enabling developers to produce robust and user-friendly code.