Generate API Documentation Easily with Docgen: A Simple, Open-Source Tool

In this tutorial, I鈥檒l introduce you to an open-source tool that makes creating amazing API documentation effortless! If you鈥檙e working with REST APIs and exposing them through HTTP/JSON, there鈥檚 a good chance you鈥檙e already using Postman to test, debug, and manage collections. When collaborating with teams, especially Android or iOS developers, you often need to share your API documentation. This typically involves sharing the Postman collection in JSON format along with manually written documentation to describe the API. ...

May 15, 2020 路 3 min 路 Saddam H

Query JSON data using聽Golang (gojsonq package)

Developers often need to consume JSON data from other services and query over it. However, querying JSON data can be time-consuming. Over the past few days, I鈥檝e been working on a Golang package to make querying JSON data easier. The idea and inspiration for this package come from PHP-JSONQ by Nahid Bin Azhar. Let鈥檚 start by looking at a sample JSON dataset: Now that we have the JSON data, let鈥檚 dive into some examples of how to query it using the package. ...

May 29, 2018 路 2 min 路 Saddam H

Let鈥檚 make a simple todo app with Go

Generally, Go is perfect for building microservices, but that doesn鈥檛 mean building a simple MVC app is difficult. Go has built-in support for parsing HTML templates, although we won鈥檛 focus on that in this case. First, let鈥檚 write the Go code to serve an HTML page and save it in a directory. In this example, let鈥檚 create a directory called todoapp and inside it, create a home.tpl file. Paste the HTML content in home.tpl, which will make an HTTP call to our backend application. ...

November 23, 2017 路 5 min 路 Saddam H

An easy way to validate Go request

When building REST APIs or web applications in Go, one of the essential tasks is validating incoming request data. Having worked on various small to medium-sized projects in Golang鈥攎ost of which are microservices providing RESTful APIs鈥擨鈥檝e employed several approaches to handle data validation. Among these, there鈥檚 one method I frequently rely on. For validating application/json or text/plain requests, I begin by defining a struct type to represent the specific request payload. Then, I implement a Validate method on that struct to encapsulate the validation logic. ...

October 18, 2017 路 2 min 路 Saddam H