API Contracts: Bringing OpenAPI and Typing to OpenStack

Image by giamboscaro / Unsplash

This talk was delivered during the OpenInfra Summit Asia in Suwon in September 2024. It focused on two efforts currently underway in the OpenStack community, one to add OpenAPI schema generation to many services, and another to add type annotations to the SDK and OpenStackClient.

OpenStack’s APIs - of both RESTful and Python variety - have evolved organically over time. This has allowed them to grow and change as new use cases have arisen (and older ones died away), but this organic growth has resulted in a large amount of cruft, weird corner cases and bugs, and generally lots of undefined behaviour, all things commonly known as tech debt. While a lot has been done to reduce this tech debt - ranging from low-hanging fruit like improved docstrings and better unit test coverage to bigger efforts like the api-ref docs and functional API tests - we know from experience that there are a non-trivial number of latent issues just waiting to be triggered. Fortunately, the broader tech ecosystem has not stood still since OpenStack was first introduced in the early 2010s. Two technologies in particular promise to massively improve how we document and understand our APIs: OpenAPI and Python type annotations. OpenAPI promises to provide a machine-readable definition of the various APIs, while Python type annotations allow us a way to provide guarantees about type information that were not previously possible in Python. In this talk, we will explore the work that has been ongoing to integrate both technologies into projects across OpenStack, how you as a user or developer can taking advantage of them, and how you can get involved.

More information is available on the OpenInfra Summit Asia 2024 website.

comments powered by Disqus