Konfig: A Framework and Toolset for Generating SDKs for Your REST API
Hey Hackers,

My name is Dylan and I wanted to share with you my product Konfig (https://konfigthis.com) - a framework and toolset to help generate SDKs for your REST API. Today we use it to generate SDKs for our customers.

Large API companies like Stripe and Plaid have amazing developer experiences in part due to their client SDKs. But most API companies do not have the bandwidth or expertise to create and maintain SDKs. With Konfig, we want to make publishing SDKs easy without compromising quality. There are great open source projects like OpenAPI Generator (https://openapi-generator.tech) that exist, but generating SDKs is still hard for two reasons.

First, it is difficult to write your OpenAPI Specification in a way that generates high quality SDKs since there are no standard best practices. And the ecosystem for generating OAS from code is immature (besides FastAPI / Swagger). So we built a linter that integrates with VSCode and a CLI that can automatically fix your OAS to quickly improve your OAS.

Second, maintaining SDKs is a pain since you have to continuously rerun the generators, test the output, properly update versions, and publish to package managers. Konfig defines a convention for organizing your SDKs and automates the linting, generation, testing, versioning (thanks to https://www.useoptic.com), and publishing of your SDKs upon changes to your OAS.

I have experience working on similar projects - before building Konfig, I spent 3 years building a DSL for implementing highly relational and big data systems at C3.ai. The DSL was used to generate millions of lines of Java to serve thousands of APIs. We created client SDKs in JavaScript, Python, and Java but it became a such a huge pain to ensure the consistency and correctness across SDKs that we created a language-agnostic framework for generating tests (we called it Polytest).

A few companies are using Konfig and we are currently looking for more API companies interested in publishing SDKs for their API. I would also love to just hear your experience providing SDKs for your API and thoughts on the API specification ecosystem as a whole. Today Konfig is not well documented and we currently operate our product on behalf of our customers but hope to improve the documentation and developer experience. But feel free to use our Spectral based linter to determine if your OAS is in good shape for SDK generation https://docs.konfigthis.com/tutorials/setup-linting.

We have some pretty cool ideas in the pipeline such as:

- building a generator with a better intermediate representation (IR) and templates to support ergonomic SDK features such as parameter state tracking and pagination
- generating docs with user code samples from the SDKs like how Stripe does it
- test case transpiler to help generate test cases in multiple languages by just writing in one (the base language is probably going to be Java for its nominal type system which is helpful for referencing schemas from the OAS but we haven’t decided yet)
- OAS vendor extensions for that can describe test cases to be generated for all SDKs

I hope you find our product interesting and I am looking forward to hearing your thoughts and feedback.