Stefan Wille


A Guide to OpenAPI Code Generation for TypeScript

May 30, 2021

In this article article I explain how to automatically generate the client code for a REST API.

The basic idea is to specify the API in a format called OpenAPI, and then feed that specification into a tool called OpenAPI Generator. The target language in this article is TypeScript.

Code generator

Why would would somebody generate code for a REST API?

  • Writing client side code for a REST API is tedious, repetitive, and error prone. Generating the code automatically solves these issues.
  • With TypeScript, it is even more desirable to generate this code, because it means that requests and responses are fully typed, including your deeply structured domain objects. There is no need to tolerate the any type.
  • Because the approach is based on a shared API specification, client and server are more likely to stay compatible.

My experience with this approach is in fact very good.


More...

The Simple Way to Customize Ant Design in React-Scripts

May 9, 2021

How to customize an Ant Design Theme in react-scripts - easily and without ejecting.

More...

Guard Bundler Tutorial - Run "bundle install" Automatically

August 2, 2015

Here I explain how to setup Guard to run 'bundle install' automatically everytime you modify your Gemfile.

More...

Guard Tutorial - Run a Command on File Change

July 27, 2015

Guard watches the files in your project directory, and responds to changes by running a configurable command or plugin. This is very useful functionality. I feel that the Guard website makes it harder than necessary to get started though. Therefore I wrote this tutorial.

More...

Redis: Crystal vs Ruby vs Node vs ...

May 26, 2015

Recently, I have published a Redis client library for Crystal called Crystal-Redis.

More...

A Redis Client for Crystal

May 21, 2015

This week I have published Crystal-Redis, a Redis client for the Crystal programming language. It is open source, full featured, well documented and is very fast.

More...

Using SPDY with Nginx 1.4

April 26, 2013

Nginx 1.4 finally went stable. This new version comes with SPDY integrated. If both web browser and server support it, SPDY improves your site's performance.

More...

Sphinx search / thinking_sphinx with german umlauts

April 17, 2012

I figured out how to get Sphinx / thinking_sphinx to handle searches with german umlauts and treat the umlauts as case insensitive.

More...

Fix for bundle install: ArgumentError: invalid byte sequence in US-ASCII

March 20, 2012

I stumbled across a weird issue with bundler on MacOS X:

More...

Creating smaller images in Rmagick

November 15, 2011

When you create an image in Rmagick and save it, chances are high that your image will be way too big. The reason is that, by default, Rmagick creates uncompressed images.

More...

Printing the page content in Capybara

December 2, 2010

Capybara is a great integration testing framework that easily replaces Webrat. Plus, it works with Rails 3, which Webrat seems not to do. If you need to print the current page's content, for example to debug your test, you can do so with:

More...

Ruby on Rails: Fix for 'invalid multibyte char (US-ASCII)'

August 31, 2010

You probably got this error message in Ruby on Rails: 'invalid multibyte char (US-ASCII)'

More...

Rails Plugin for Single Sign On with Atlassian Crowd

July 27, 2010

Atlassian Crowd offers a simple solution for single sign on. It comes with an authentication server, a web based administration console and Java client libraries. Other Atlassian products such as Jira, Confluence and Bamboo integrate with Crowd. With the crowd_rails plugin, Ruby on Rails can also benefit from single sign on with Atlassian Crowd 2.0.

More...

Version 0.5.10 of Crowd Gem Released

July 26, 2010

The new version 0.5.10 of the crowd-stefanwille fixes a bug in handling of validation factors.

More...

Ruby Gem for Crowd 2

July 19, 2010

I took the Ruby client gem for Atlassian Crowd 1.6 and updated it for Crowd 2.

More...

Why 'bundle install' is slow (and how to make it fast)

July 12, 2010

I use Bundler's command `bundle install` with Capistrano and it used to takes many seconds to complete. The reason was that Bundler fetched all required gems unless they were already installed and then checked for all dependent gems if there is are newer versions available and installed these. It's the last step that took so long.

More...

Why You Should Split Your Epics Into Smaller User Stories

April 6, 2010

Probably every agile book recommends to split large user stories (epics) into smaller ones. But why? The reason is usually 'because they are more manageable', but I didn't really understand what that was supposed to mean. Until recently, when we worked on two epics. And I had an insight that I am eager to share.

More...

Let Business People Get Their Statistics Themselves

January 13, 2010

I found that, once you have software in production, your business people ask for numbers, statistics and reports from your database, on a weekly or monthly basis. And this keeps interrupting your workflow. And it also keeps you from coding. So what to do?

More...

Looking for Ruby on Rails Developer for Balao in Hamburg

October 28, 2009

I am searching for a new colleague: A sharp, experienced Ruby on Rails developer for our internet startup Balao in Hamburg.

More...

Spring & Hibernate on Google Books

September 10, 2009

Google Books has scanned my book Spring & Hibernate:

More...

They Pirated my Book

September 9, 2009

I found an illegal copy of my book on RapidShare.

More...

BizSphere Explained

May 7, 2009

SVA BizSphere GmbH has a great page up that describes its product BizSphere, the software that I worked on over the past 2.5 years.

More...

Content Landscape

April 5, 2009

Here is a description of Content Landscape, a project for which I did architecture and specification work during my BizSphere engagement.

More...

Spring & Hibernate, 2nd Edition

February 24, 2008

Our publisher will start selling the second edition of our book _Spring & Hibernate_ in April, 2008.

More...

Scrum Master Certification

December 14, 2006

On November 23, 2006 I became a Certified Scrum Master (CSM).

More...

Talk about Hibernate at Lehmann's Book Shop

November 12, 2006

On October 26, I spoke about Hibernate at Lehmann's book shop in Hamburg.

More...

Book 'Go To JavaServer Pages'

June 27, 2006

A few years ago, I wrote a book called 'Go To JavaServer Pages'. It was published by Addison Wesley in 2001.

More...