Create OpenAPI Specification In Existing SpringBoot Project

Introduction The OpenAPI specification is used to design the REST API structure, it is an agreement that clients use to call those REST API services. As per industry standard, we design the OpenAPI specification first, then utilise it in applications to generate REST API services. This phase is not helpful for ongoing projects if a REST API has already been developed because it is a new practise. We need a clever solution to automatically build OpenAPI specifications for these kinds of projects so that their clients can utilise the specifications to create client applications or conduct testing....

June 19, 2023

How To Use @ConfigurationProperties In Spring Boot

Introduction This tutorial will show you how to use @ConfigurationProperties in a Spring Boot application. This annotation is designed to load properties from an application property file into an application context and configure them using a Java object. Why do we need @ConfigurationProperties? What about the @Value annotation? The typical method of registering configuration properties to a Java object field in a Spring Boot application is the @Value annotation, but it is only acceptable for single independent configuration....

February 9, 2023

Online YAML to JSON Converter

What is YAML to JSON converter tool Convert YAML to JSON for free, quickly, and conveniently in your browser. Enter your input below and click the Convert button. The result will be displayed below the Convert button. Enter the YAML Clear Convert JSON What is YAML YAML is a human-readable data-serialization language. It is frequently used in configuration files as well as programmes that store or transport data....

January 11, 2023

How To Make Spring Boot Controller Unit Test Faster

Introduction There are several methods for testing Rest controllers in the Spring Boot framework, and this post will demonstrate one of the quickest. Tools Spring Boot: 2.7.6 Java : 11 Rest Controller Let’s create a simple REST API controller with one service to fetch the data from the database. UserController.java @RestController public class UserController { private final UserService userService; public UserController(final UserService userService) { this.userService = userService; } @PostMapping(path = "/user", consumes = MediaType....

January 10, 2023

SHA-256 Online Tool

Enter the input Clear Hash SHA-256 What is SHA-256? SHA-256 is a cryptographic hash function that accepts a random-sized input and returns a 256-bit fixed-size hash as an output. Because of their one-way output, such hashes are extremely powerful. Simply said, you can generate a hash output from any given input, but you cannot reconstruct the original data from the same hash output....

January 7, 2023

Base64 Online Tool

Encode Decode Enter the text for Clear Base64 Base64 Base64 Encoder / Decoder Online Base64 Decode is a simple utility for decoding or encoding base64 data to plain text. What exactly is Base64? Base64 is a family of binary-to-text encoding techniques that convert binary data in an ASCII string format into a radix-64 representation. Base64 is commonly used to encode binary data in email messages and web pages....

January 5, 2023

Create Maven Project Through Command Line

Introduction How often do you create a Maven project from your preferred editor? The response would be frequently or always. But have you ever thought about what Maven command your editor used to create the project? Yes, maven projects are built solely with the maven command, exactly as “mvn clean install” is used to create a project’s jar file. This tutorial will teach you about such a command. Maven Command Open your terminal and navigate to the directory in which you want to create a new Maven project....

November 29, 2022

Easy Steps To Create Log4j2 Rolling File For Spring Boot

Introduction Spring Boot applications can save informative messages or application errors to a file. This functionality allows you to monitor the application’s health and take necessary action when problems arise. Logging all of this information to a single file, on the other hand, will cause the file to expand in size, which would be a nightmare if the file size rose to MB or GB and you wanted to trace a specific exception throughout the whole log file....

November 20, 2022

Two Steps To Add Log4j2 To Spring Boot Application

Introduction Log4j2 is a comprehensive and modern framework for logging messages in applications. And Spring Boot, which is widely used in industry, provides excellent support for Log4j2. In this tutorial, we will look at how to configure it using an XML and YAML file. Setup Download the Spring Boot application from Spring Boot Starter and extract the zip file. POM Configuration Add log4j2 as a dependency to the pom.xml file. pom....

November 17, 2022

First Step Toward Spring Boot Cloud Gateway

Introduction This tutorial is a short introduction to Spring Cloud Gateway. By following the quick and easy steps provided below, you will be able to start the REST API gateway project. Prerequisite Java Maven Spring Boot Download the Spring Boot project from Spring Initializr and select Gateway as dependency. Now generate and download the project and use your favourite editor to import it. Gateway Configuration You can use a YAML file or Java code to configure routes....

November 7, 2022