{"API Evangelist"}

Auto-Generating Code Using Swagger Still Means You Will Get Your Hands Dirty

Yay! Another story generated by listening to Traffic and Weather (blame John and Steve). I do enjoy sharing my random thoughts while listening to those two. This one is around the SDK discussion during the latest episode, but as they noted, they’ve talked about SDKs a lot in the past. This particular reference was again, during the their discussion about Microsoft using Swagger to generate code—a topic which brought up the usual grumbles from John about SDKs. He loves to hate on SDKs, obviously suffering from severe SDK PTSD.

I agree with his feelings about SDKs, they are well founded, but auto-generating code from Swagger doesn’t always involve with the generation of full-blown SDKs. I save a huge amount of time, auto-generating different types of code and scripts from Swagger, which I further clean up and make work for my specific needs. My experience with generating code from Swagger, is more about saving time, than it is about producing production ready SDKs.

Maybe my development world is unique, but I find I still have to get my hands dirty, even when I generate server or client side code using Swagger, requiring me to still play with HTTP and understand response / request details. I get what John is saying, and he is right. I'm increasingly frustrated by companies producing platforms that are more SDK than API, something IoT engineers excel at.

I just wanted to point out there are many layers to the discussion, and that there are no perfect solutions when auto-generating code from API definitions, but it can sure save time in both API deployment, as well as API consumption, and unlike SDKs I still understand the inner working of my apps, integrations, and the APIs they are depending on.