OPI Blog
Learn from experts in their fields

Browsing Tags: Modern API

Mar 1, 2018
Log your RestTemplate Request and Response without destroying the body
When you’re working with REST services, it can be very useful for debugging to be able to log both the request and the response info. Fortunately, if you’re using the Spring framework’s RestTemplate its fairly ...
RestTemplate Status Code Handling
I was writing a  Spring Boot microservice that called an external service. If the service returned a `500`, the payload of the response had an error code that we wanted to send back to the ...
Passing Command Line Arguments to a Spring Boot Application via a bootRun Task in Gradle
There currently seems to be no easy way to pass arguments to a Spring Boot application launched using the bootRun task in Gradle. There are plenty of stack overflow questions asking about this and at ...
Build your svg on the server using Swagger, Node, Express
Recently, I had the need to share an svg chart between a javascript (React) app, an android app, and an iOS app. One option would be to write code in all three application to generate ...
Nov 28, 2017
Missing Codecs in MongoDB
When upgrading a project’s Mongo driver from 2.13.0 to 3.4.2, we got the following exception: org.bson.codecs.configuration.CodecConfigurationException: can't find a codec for class java.math.BigDecimal. Well it seems that Mongo doesn’t support BigDecimal any longer. There we ...
Spring Webflux – Functional Endpoints
I’m a big fan of Spring and was excited when Spring announced that Spring 5 had been released. I was curious about the new Functional Endpoints that were introduced in Spring 5 and wanted to ...
Nov 8, 2017
Handy Gradle Recipes
I’ve been trying to simplify my tools lately – less reliance on Intelij IDEA and using the command line more and more. At times, I feel like my workflow has sped up because of a ...
Sep 22, 2017
Getting XML Directly from PostgreSQL
There was a discussion on our company Slack recently about databases and XML, and someone pointed out that PostgreSQL has some nice XML functions. I’m a Postgres fan and knew that it had some XML ...
Database Migrations in Flyway
The concept of data migrations has been around for a long time and in the past, they have been projects that are separated from the main project, mostly with SQL script to change the tables, ...
May 4, 2017
Easily Convert from Ant to Gradle
I stumbled onto an old application that hasn’t been touched for many years. The code was honestly well-written but it used Ant (without Ivy) to build. That is cumbersome in this day and age. I ...