This repository contains the foundational boilerplate code used by Sideko for generating SDK client libraries. Unlike traditional SDK generators that rely on templates, Sideko employs advanced syntax tree analysis to generate code that closely mirrors human-written code.
Currently, this repository includes boilerplate code for:
Sideko generates SDKs in many other languages, and those boilerplates will be added to this library in the future.
Sideko takes a unique approach to SDK generation:
- The boilerplate code in this repository serves as the starting point
- Sideko's analyzer, written in Rust, processes your API specification
- Using syntax tree analysis, it augments the boilerplate with API-specific code
- The result is a maintainable, high-quality SDK that can be modified
- Currently, users of Sideko can add new files to the repos, modify the README, and add other dependencies, and annotate the generated files in a few specific files
- In the future, most of SDK will be editable, unlocking ultimate flexibility in the SDKs
This approach offers several advantages over template-based generation:
- More natural, human-like code structure
- Better code quality and maintainability
- Safe manual editing without breaking regeneration capability
- Consistent coding patterns across different APIs
The repository includes example generated SDKs for the Swagger Petstore API (./petstore-openapi.json
) to demonstrate the output structure and generated documentation.
- The actual code generation is performed by Sideko's generation engine written in Rust
- Generated code is also formatted by the Rust generation engine
- Generation is executed via Sideko's API
- The boilerplate usually serves to help generated code utilize auth, make network requests, parse responses, stream data, ect. Each langauge is different, and sometimes the generated code has to do more work. For a language like Python, the boilerplate actually does a lot.
- Sideko SDKs are fully typed, but the type systems require no boilerplate, so there is no type-related code in this repo.
To use Sideko for generating your own SDKs visit Sideko's website
While this repository primarily serves as a reference for Sideko's boilerplate code, we welcome:
- Documentation improvements
- Boilerplate Code improvements
- SDK Generator improvements - tell us something you'd like to see changed referencing the example SDK
For more information about Sideko and our SDK generation capabilities, visit sideko.dev.