Skip to main content

· 3 min read

Last week we merged our plugin into Backstage (Pull Request) to generate SDKs for internal services. For those that love to follow and discuss technology, we also published a blog post where Dylan reviewed 1,000s of GraphQL vs. REST perspectives. We also made a lot of improvements to our Python, TypeScript, and PHP SDK generators.

Backstage Plugin

SDKs help onboard external developers but we know that the same problem exists inside organizations when integrating APIs from different teams owning different services. Backstage is a developer portal for centralizing your infrastructure and enabling product teams to quickly ship high-quality code. So we created a Backstage plugin to auto-generate SDKs for internal API services. If you are interested in generating SDKs for your internal APIs please reach out to us and we would love to talk. Check out our official plugin here!

Backstage Plugin
Backstage Plugin Marketplace with our official SDK generation plugin

Blog Post: I Reviewed 1,000s of GraphQL vs. REST Perspectives

Ask any developer: do you prefer GraphQL or REST? This often leads to opinionated conversations, sometimes even devolving into vulgar opinions rather than objective facts. To delve into the GraphQL vs. REST debate, I scoured platforms where developers frequently discuss such matters: YouTube, Reddit, Twitter, and Hacker News. I parsed 1,000s of discussions and synthesized my findings in this blog post, striving to present only thought-provoking perspectives. Read more here!

GraphQL vs. REST Blog Post
I reviewed 1,000s of GraphQL vs. REST Perspectives in our latest blog post Improvements and Fixes (there are lots of them this past two weeks!)
Improvements and Fixes
  • Konfig CLI now gives a warning to update to the latest version
  • Added "changeset" command for Konfig CLI to automate SDK generation using GitHub actions
  • When running "konfig generate", if "specInputPath" is set then "konfig fix" is also executed
  • Fix generated documentation referring to non-existent response variable in Python SDK
  • Konfig CLI now always runs a mock server when running "konfig test"
  • Custom package.json scripts can be added to TypeScript SDK using konfig.yaml
  • Fix bug in Python SDK where unexpected keyword argument error is thrown when attaching extra properties to request bodies inside a customized SDK
  • Add label to top-level README to differentiate SDKs that have PHP 7+ or PHP 8+ support (see SDK table in example README)
  • Reference OpenAPI "tag" instead of "class" inside operation table in generated TypeScript SDK README
  • Add flag "useDescriptionInOperationTableDocumentation" to konfig.yaml for TypeScript SDK to use "description" instead of "summary" field from operation in generated operation table for README.md
  • Fix "ReadableStream" not defined in TypeScript SDK when API error is encountered in Node.js
  • Improve PHP 7+ support option
  • Error is now thrown if "topLevelOperations" references an operation ID that does not exist in the OAS
  • Fix bug where required path parameter causes syntax issue in Python SDK
  • Fix bug where dictionaries in generated Python SDK documentation was using "=" instead of ":" for dict values
  • Add "konfig published" command for listing all currently published SDKs
  • Add "konfig lint-python" command to run Ruff linter on Python SDK
  • Fix bug in Python SDK where "_headers" is undefined
  • Handle generators listed under "additionalGenerators" when using "konfig bump"

· 10 min read
Dylan Huang

Ask any developer: do you prefer GraphQL or REST? This often leads to opinionated conversations, sometimes even devolving into vulgar opinions rather than objective facts.

To delve into the GraphQL vs. REST debate, I scoured platforms where developers frequently discuss such matters: YouTube, Reddit, Twitter, and Hacker News. I parsed 1,000s of discussions and synthesized my findings in this article, striving to present only thought-provoking perspectives.

Discussion funnel
Funnel for gathering through-provoking perspectives

Next, I transcribed these discussions onto a whiteboard, organizing them into "Pro GraphQL," "Pro REST," or "Neutral" categories, and then clustering them into distinct perspectives. Each section in this post showcases a perspective while referencing pertinent discussions. To conclude, I highlight blog posts from GitHub and Shopify that serve as informative case studies in this ongoing debate.

FigJam
FigJam I used to organize perspectives

· 3 min read

At Konfig, we are rapidly making progress towards building the easiest way to onboard developers to your API. To keep our followers up-to-date, we are starting this newsletter that will feature 2-3 of our biggest product updates and little fixes.

STATISTICS.md

Now konfig generate will generate a file named STATISTICS.md that contains a count for Lines of Code in each SDK for your API. Here is an example that we generated. This file is generated in the same directory as your konfig.yaml file. In the future, we would also like to add more data such as weekly downloads.

STATISTICS.md

_11
# SDK Statistics
_11
_11
| SDK Name | Lines of Code |
_11
|------------|---------------|
_11
| java | 89900 |
_11
| ruby | 47516 |
_11
| python | 104319 |
_11
| typescript | 18063 |
_11
| csharp | 58322 |
_11
| php | 99705 |
_11
| **Total** | 417825 |

Interactive Tutorial

Our interactive tutorial is now live! Learn how to generate SDKs with a guided interface. This is a great way to get started with Konfig if you would like to generate SDKs yourself.

Interactive Tutorial

Improved TypeScript SDK Error

Instead of just throwing the error from the underlying request library, axios, we now generate a file called error.ts that contains a custom Error class. The name of the class is based off the client name in your konfig.yaml file. The new custom error message has a cleaner interface and better inline documentation. In a Next.js API environment, the logged errors now exclude a lot of the garbage that was not helpful when debugging.

error.ts

_36
/**
_36
* This class provides a wrapper for network errors when making requests to OpenAPI Petstore
_36
*/
_36
export class AcmeError extends Error {
_36
/**
_36
* The response body
_36
*/
_36
readonly responseBody: unknown;
_36
_36
/**
_36
* The error code provided from the underlying "axios" library which can be
_36
* more descriptive than the HTTP status descriptions.
_36
*/
_36
readonly code?: string;
_36
_36
/**
_36
* The status code from the response.
_36
* For explanations, refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
_36
*/
_36
readonly status?: number;
_36
_36
/**
_36
* The status text from the response.
_36
* For explanations, refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
_36
*/
_36
readonly statusText?: string;
_36
_36
/**
_36
* The URL that the original request was sent to
_36
*/
_36
readonly url?: string;
_36
_36
/**
_36
* HTTP request method (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)
_36
*/
_36
readonly method?: string;

Improvements and Fixes
  • Support for GitLab publishing in Java SDK
  • Streaming support in TypeScript SDK for Node.js environments
  • Improved class hierarchy in TypeScript SDK to allow for custom classes to call generated methods
  • Improved class hierarchy in Java SDK to allow for custom classes to call generated methods
  • Fixed bug in Python SDK when circular dependency was present in OpenAPI spec

· 17 min read
Dylan Huang

Imagine you are tasked to write 417,823 lines of code in 6 different languages. What if there was a way to slash that development effort significantly with just a fraction of the effort? Introducing code generation, where a few high-level instructions can do the work for you. In this blog post, we'll dive into the superpower of code generation, uncovering its presence from early programming to modern-day AI assistants.

· 5 min read
Dylan Huang

What exactly is an OpenAPI? In this article, we'll cover the problem that OpenAPI solves and explore its importance in modern software architecture.

As software systems become more interconnected, OpenAPI has emerged as a vital tool for promoting collaboration and enabling seamless integration between different applications. Today large API-first companies like Stripe and Plaid use OpenAPI so it's no surprise that OpenAPI is finding widespread adoption.

Google trend on openapi from 1/1/2017 to 7/10/2023
Google trend on "openapi" from 1/1/2017 to 7/10/2023

· 13 min read
Dylan Huang

Postman

Originally started as a side project, Postman has become one of the best tools for collaboratively building APIs with over 1.29 billion requests created in the past year.

As organizations' investments of time and resources into APIs increase, API-first organizations must leverage testing tools like Postman. Adopting an API tool is an effective way to save thousands of engineering hours.

· 8 min read
Dylan Huang

SDKs makes the integration of REST APIs easier by packaging boilerplate code for developers.

Why do developers need help integrating APIs?

Let's take a look at the numbers.

Plaid has a REST API with 215 operations, 1346 schemas, and 215 parameters.

SnapTrade has a REST API with 91 operations, 125 schemas, and 183 parameters.

Twilio has a REST API with 199 operations, 152 schemas, and 874 parameters.

The complexity of these APIs can be daunting for developers who are under a time pressure to integrate an API and frustrating for API companies because onboarding is time consuming. Developers are required to parse tons of documentation and code while API companies must provide continuous support for a successful partnership. To make matters worse, developers can be using a programming language that nobody at the API company knows. To alleviate the pain, best-in-class API companies publish SDKs to accelerate the integration process.