Git Product home page Git Product logo

study-springboot-i18n's Introduction

My Stock Mgmt Banner image with an anthropomorphous bull with glasses wearing an white office shirt, holding a pencil in one hand and a notebook in another and the title 'My Stock Mgmt'

Spring icon Docker icon

⤴️ Table of Contents

❓ About

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"
}

Back to Top

🏃 How to Run

The docker-compose should be at version 2.21 or greater.

IntelliJ

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.

find the springbooti18nApplication and execute it

In case of an error for missing dependencies, reload it with maven command "Reload All Maven Projects":

Back to Top

Maven

mvn spring-boot:run

Back to Top

Docker

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

Back to Top

🚦 How to Test

Intellij

To run all the unit and integration tests, right-click on the root folder and select "Run All Tests".

find the SpringbootI18nApplication and execute it

Back to Top

Maven

Unit tests:

mvn test

Unit tests + Integration tests:

mvn verify

Back to Top

Docker

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

Back to Top

Manually

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"
  }
}

Back to Top

📖 Documentation

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

Back to Top

🔧 Tools

Check the HELP.md file with a list of links and articles about the tools used in this project.

Back to Top

📖 References

Back to Top

study-springboot-i18n's People

Contributors

marciovmartins avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.