manufacturist / newtypes-tapir-example

Proof of concept for monix/newtypes and Tapir integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newtypes Tapir Example

The goal of this project is to showcase how we can use newtypes with tapir to:

  • Improve our domain model reasoning
  • Enhance type descriptions
  • Add a basic implementation of validation rules
  • Reference field types to external documentation

The used dependencies are monix/newtypes, tapir, http4s, cats, cats-effect & circe.

To run the project just do sbt run. You should see:

INFO  yyyy-MM-ddTHH:mm:ss.SSSZ o.h.b.c.n.NIO1SocketServerGroup - Service bound to address /127.0.0.1:9001 
INFO  yyyy-MM-ddTHH:mm:ss.SSSZ o.h.b.s.BlazeServerBuilder - http4s v0.23.6 on blaze v0.15.2 started at http://127.0.0.1:9001/ 
INFO  yyyy-MM-ddTHH:mm:ss.SSSZ busymachines.Main - Swagger at http://localhost:9001/api/public/swagger 
INFO  yyyy-MM-ddTHH:mm:ss.SSSZ busymachines.Main - Redoc at http://localhost:9001/api/public/redoc  

You can now check the documentation at localhost:9001/api/public/docs/index.html.

About

Proof of concept for monix/newtypes and Tapir integration

License:Apache License 2.0


Languages

Language:Scala 100.0%