Skip to content

This repository demonstrates an Api First Design approach of building simple Spring Boot Todo Service.

License

Notifications You must be signed in to change notification settings

rbiedrawa/spring-api-first-design-poc

Repository files navigation

Api First Design - Spring Boot demo

This repository demonstrates an api first approach of building simple Todo Service.

Contract first means that we're developing a specification before we begin implementing our service.

Features

  • Api First Design
  • OpenAPI 3.0
  • OpenAPI Generator
  • Swagger UI
  • Grouped APIs in SwaggerUI

Getting Started

Prerequisites:

  • Java 11

Usage:

  1. Check Todo Service OpenAPI specification. Open src/main/resources/api.yml
  2. Generate Spring controllers and models from the specification using Gradle plugin
    ./gradlew openApiGenerate
  3. Investigate generated models and controllers interfaces under build/generated/sources/src/main/java directory
  4. Check TodoController implementation
  5. Add new endpoint or model to the service
    1. Update OpenAPI spec in api.yml
    2. Generate the new models or controllers by running again./gradlew openApiGenerate
    3. Implement any new features
  6. Start Todo Service
    ./gradlew bootRun
  7. Open Swagger UI page and play with API 😉 grouped-api.png

Useful tools

References

For further reference, please consider the following sections:

License

Distributed under the MIT License. See LICENSE for more information.

Releases

No releases published

Packages

No packages published

Languages