March 2024 - Python v2
Welcome to our first set of release notes! We have a lot of exciting updates to share with you this month, including the release of v2 of our Python SDK generation and more. Let's dive in!
Python v2
Hot off the presses is a new version of our Python SDK generation, focusing on usability, efficiency and developer experience.
- Input casting - The
cast_models
feature will simplify the process of handling user input by automatically converting values into model instances. When passing data to a request, your SDK can convert dictionaries into models, and cast primitive types to their expected values, making it easier for your users to interact with your API. - Input validation - In OpenAPI you can define validation rules for input, such as the format of a string, or the range of a number. The Python SDK will now validate input data against these rules, and raise an exception if the data is invalid. This means if your user sends invalid data, they will get an error immediately, rather than waiting for the API to respond, meaning less erroneous calls to your API.
- Output validation - As well as validating data on the way in, data is also validated on the way out. This means that if your API returns unexpected data, the SDK will raise an exception, rather than silently returning the data.
- Improved docstrings - For your users to be successful with your SDK, they need to understand how to use it, and that comes down to documentation. We've improved how we add the documentation from your OpenAPI spec into your SDKs by supporting reST docstrings, improving the in-IDE documentation experience. This also allows you to generate Python SDK documentation using Sphinx.
You can read more details, including a deeper dive into some of these features in our Python v2 blog post. You can enable Python v2 in your SDK by setting the liblabVersion
option for Python in your config file to "2"
.
Python v2 is a major version update, so there are breaking changes between SDKs generated with v1 and v2. We will be supporting both versions for the foreseeable future, so you can choose when to upgrade.
If you need help with the upgrade, please reach out either using out contact form or via our discord server.
Other improvements and bug fixes
We've been making a lot of improvements to liblab this month, adding more features and squashing the occasional bug. Here are some of the highlights:
SDK generation
- Updated our C# and Go betas to get them closer to a release candidate, including:
- Support for basic, API key, bearer token, and custom access token authentication methods.
- Improved SDK client configuration with a simplified client constructor and configuration object.
- Support for multiple API environments.
- Squashed a few npm warnings when building SDKs using the liblab CLI.
Terraform provider generation
- Separated Terraform hooks from Go hooks, allowing you to have separate hooks code if you are generating a Terraform provider and a standalone Go SDK.
- Added a customization capability to rename the fields in your provider schema.
- Terraform providers now include a GitHub Action to automatically publish your provider to the Terraform registry.
Automation
- Published a new GitHub Action to the GitHub Actions marketplace to regenerate your SDKs when there is a new version of liblab released.
liblab portal
- Audit trails can now be exported to CSV, allowing you to keep a record of all changes made to your organization.