Git Product home page Git Product logo

spring-boot-playground's Introduction

Spring Boot Playground

This playground project is intended to be a demonstration of the Spring Boot Data Fixtures project and additionally be blueprint/reference for the fresh Spring Boot services.

The project is intended to be developer friendly, highly testable and aligned with the API First principe. Individual features are listed below.

Spring boot data fixtures demo

Sources:

Running the project locally

mvn spring-boot:run -PswaggerUI

API First approach and OpenAPI generator

The DTOs and controller interfaces are generated out of the swagger.yml definition by using https://github.com/OpenAPITools/openapi-generator.

The code templates are copied and customized. The original ones can be found at https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources The templates were forked at the f5151de9fcb35cb58f86df2bb3d948b3ef96cfa8 commit.

The full list of the generator options can be found at https://openapi-generator.tech/docs/generators/spring/

Changes comparing to the original templates:

  • Removed @Api* annotations - these annotations come from Swagger 2.0 package. When using OpenAPI 3.0 to generate the code, these annotations are not very useful and might lose come context (Swagger 2.0 VS OpenAPI 3.0). These annotations are only useful when Swagger 2.0 file is generated from the code - which is against API First principle. Assuming that OpenAPI definition is already part of the project, these annotations provide no extra value forcing you to add additional dependency at the same time.
  • Removed Generated annotations
  • Added Lombok @Data annotation to models and removed hashCode and equals methods, moved vendorExtensions.x-extra-annotation from getter to property name
  • Removed unnecessary code comments

Testing

The application is tested using integration tests against a running application. The application uses a real Postgres database started using TestContainers.

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.