Adam Warski – Your HTTP endpoints are data, as well!

Adam Warski

Adam Warski

I am one of the co-founders of SoftwareMill, where I code mainly using Scala and other interesting technologies. I am involved in open-source projects, such as sttp, MacWire, Quicklens, ElasticMQ and others. I have been a speaker at major conferences, such as JavaOne, LambdaConf, Devoxx and ScalaDays.

Apart from writing closed- and open-source software, in my free time I try to read the Internet on various (functional) programming-related subjects. Any ideas or insights usually end up with a blog (https://softwaremill.com/blog)

Your HTTP endpoints are data, as well!

We’re used to defining HTTP API endpoints using annotations (@GET@Param, …), that is, using metadata. Why not take it one step further, and use a “normal” data structure to describe endpoints? A data structure which we could manipulate and abstract over as any other value in our system.

How would the code look like? What kind of operations can we perform, once our endpoints are represented as data? What do we gain? And do we loose anything? Is the resulting code readable?

In this live-coding talk we’ll implement a simple HTTP API from scratch, using Scala and the tapir library, which takes the approach described above. Basic Scala knowledge (or even no Scala knowledge at all) will be sufficient to follow.

Come and see how functional programming improves on the status quo and provides an elegant and flexible solution to an everyday problem!

Scala Valentines #5, Part 2