Lists are an essential component of many Python programs. Weather you are creating a list of people who are in an office room, or you are working on data for a machine learning program, you will eventually need to use and work with a list data structure to manage your data. Python provides a flexible […]
String manipulation in Python
Strings are central and important components in any programming language and they are needed in almost any type of application (commercial, scientific, medical, etc..). Think of all things you can store in a String such as names, addresses, communication data and much more. Therefore, it is important to get to know how to use and […]
How to configure path variables in Spring controllers
Path variables are an essential component which we use when interacting with REST APIs. In this tutorial, we will discuss what path variables are (not to be confused with query parameters) and how to use and configure them in Spring controllers. If you are just starting out with building REST APIs in Spring or Spring […]
How to configure query parameters in Spring Controllers
In this post, we will discuss what query parameters are and how to configure them in a Spring controller using the @RequestParam annotation. We will also discuss how to set your query parameters as optional, how to configure multiple query parameters and more. Before we start, I highly recommend that you check out our introductory […]
The Java Bean Validation Cheat Sheet
In our previous post, we discussed how to use Java bean validation (AKA JSR-303 or Jakarta Bean Validation) in your Spring Boot and Java applications. We also discussed in a separate post, how to use bean validation to validate REST API calls. However, we only introduced a very small subset of the constraints that are […]
How to use Java Bean Validation in Spring Boot
Java bean validation, AKA JSR-303 is a Java standard which is used to perform validation on items inside a Java application. Validation is performed by applying “constraints” on data items. As long as the data satisfies these constraints, it will be considered valid. Such constraints can be a specific numerical value range, being null or […]
Error handling in REST and Spring Boot
In our previous tutorials, we discussed how build a CRUD REST API in a Spring Boot environment. However, we have not yet discussed how to handle common errors that can occur, such as when the user tries to fetch a non-existing item. In this tutorial, we will discuss some solutions and strategies for handling errors […]
Using PUT vs PATCH when building a REST API in Spring
In our previous post “how to create a CRUD REST API in Spring Boot”, we discussed how to create a basic REST interface in Spring boot using the different HTTP verb mapping annotations @GetMapping, @DeleteMapping, @PutMapping and @PostMapping. These mappings correspond to the HTTP methods GET, DELETE, PUT and POST respectively. However, we have not […]
How to validate REST calls in Spring Boot
In our previous post, we discussed how to get started with REST in Spring boot, and how to get a REST endpoint up and running. However, callers of the endpoint were able to send any data to our server, and this data would be accepted and saved by our server without any sort of checks […]
How to create a CRUD REST API in Spring Boot
REST APIs are a very important layer in many Spring applications. Specially if you need to provide interfaces for other services in your ecosystem such as front-end applications or to external systems, such as customer systems. In this post, we will discuss how to start building your REST API using Spring Boot in order to […]