- ❓ About
- 🏃 How to Run
- 🚦 How to Test
- 📖 Documentation
- 🔧 Tools
- 📖 References
Study about Spring Boot with i18n and Problem Detail.
The default error message do not provide useful information. The ResponseEntityExceptionHandler is extended and expanded the error information. Also, an HTML page was added with a human-readable documentation that can be followed and get more details about the error.
The problem+detail
response was expanded to contain useful information about the errors:
{
"errors": [
{
"detail": "size must be between 1 and 250",
"pointer": "name"
}
],
"type": "http://localhost:8080/api-docs/errors/v1/validation-failure",
"title": "Validation failure",
"status": 400,
"instance": "/people/8c78fa21-cc03-4ef1-8882-cd51e208b7d2"
}
The docker-compose should be at version 2.21 or greater.
Find the main file at: src/main/kotlin/dev/martins/marcio/studies/springbooti18n/SpringbootI18nApplication.kt
Execute it clicking on the "play" button and after that in Run.
In case of an error for missing dependencies, reload it with maven command "Reload All Maven Projects":
mvn spring-boot:run
docker run --rm -v $PWD/src:/src -v $PWD/pom.xml:/pom.xml -v $PWD/config:/config -v data:/root/.m2 -p 8080:8080 maven:3.8.8-eclipse-temurin-21-alpine mvn spring-boot:run
To run all the unit and integration tests, right-click on the root folder and select "Run All Tests".
Unit tests:
mvn test
Unit tests + Integration tests:
mvn verify
Unit tests:
docker run --rm -v $PWD/src:/src -v $PWD/pom.xml:/pom.xml -v $PWD/config:/config -v data:/root/.m2 -p 8080:8080 maven:3.8.8-eclipse-temurin-21-alpine mvn test
Unit tests + Integration tests:
docker run --rm -v $PWD/src:/src -v $PWD/pom.xml:/pom.xml -v $PWD/config:/config -v data:/root/.m2 -p 8080:8080 maven:3.8.8-eclipse-temurin-21-alpine mvn verify
There are scripts to help you to make requests to the application. Check the steps below:
The application must be running, check the documentation section for some useful links and check the intellij http client scripts folder which already contains requests scripts.
Check IntelliJ Http Client Documentation about how to set up the private variables. For example:
http-client.private.env.json
{
"development": {
"person_name": "John Doe",
"person_age": "18"
}
}
The application use the HATEOAS principle with HALS and HALS Form. From the root resource it is possible to discover the api capabilities.
There is also OpenApi documentation:
Env | Url |
---|---|
Local | http://localhost:8080/api-docs |
And the open api json is defined at:
Env | Url |
---|---|
Local | http://localhost:8080/openapi.json |
Check the HELP.md file with a list of links and articles about the tools used in this project.
- simpleicons.org
-
Banner created by Marcio Martins
with Bing Copilot
and GIMP
A person sitting in a desk with a computer with a talking balloon, like in a cartoon, saying the word 'i18n', from Internationalization. The man is a student from Brazil.
original image