{"id":16445303,"url":"https://github.com/lloydmeta/todddo-openapi-java","last_synced_at":"2025-07-21T08:01:54.590Z","repository":{"id":141731376,"uuid":"232555506","full_name":"lloydmeta/todddo-openapi-java","owner":"lloydmeta","description":"An exploration of modern Java API dev by building a reactive non-trivial app with DDD-esque structuring.","archived":false,"fork":false,"pushed_at":"2020-01-09T11:09:11.000Z","size":350,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-26T09:46:47.208Z","etag":null,"topics":["api","ddd-patterns","functionaljava","graal-native","java","micronaut-java-application","reactive-programming","rxjava2"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lloydmeta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-08T12:11:58.000Z","updated_at":"2021-03-23T19:43:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"2cc4724b-f4ce-4dd8-b1f4-2d519e4cbe58","html_url":"https://github.com/lloydmeta/todddo-openapi-java","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lloydmeta/todddo-openapi-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydmeta%2Ftodddo-openapi-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydmeta%2Ftodddo-openapi-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydmeta%2Ftodddo-openapi-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydmeta%2Ftodddo-openapi-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lloydmeta","download_url":"https://codeload.github.com/lloydmeta/todddo-openapi-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lloydmeta%2Ftodddo-openapi-java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266263057,"owners_count":23901353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","ddd-patterns","functionaljava","graal-native","java","micronaut-java-application","reactive-programming","rxjava2"],"created_at":"2024-10-11T09:43:57.699Z","updated_at":"2025-07-21T08:01:54.554Z","avatar_url":"https://github.com/lloydmeta.png","language":"Java","readme":"## todddo-openapi-java [![Build Status](https://travis-ci.org/lloydmeta/todddo-openapi-java.svg?branch=master)](https://travis-ci.org/lloydmeta/todddo-openapi-java) [![codecov](https://codecov.io/gh/lloydmeta/todddo-openapi-java/branch/master/graph/badge.svg)](https://codecov.io/gh/lloydmeta/todddo-openapi-java)\n\nAn exploration of modern Java API development by building a non-trivial app with DDD-esque structuring.\n\nExplores:\n\n- [Micronaut](http://micronaut.io) web framework\n- [OpenApi](https://www.openapis.org)\n- [Gradle](https://gradle.org)\n\t- Subprojects\n\t- Configuring dependency constraints\n- [Lombok](https://projectlombok.org) for immutable data structures\n- [Functional Java](https://www.functionaljava.org) for some FP data structures (`Either`)\n- [MapStruct](https://mapstruct.org) for compile-time-safe mapping between data types\n- [Gaal native image](https://www.graalvm.org/docs/reference-manual/native-image/) generation\n- [Spotless](https://github.com/diffplug/spotless) for enforcing style\n- [JaCoCo](https://www.eclemma.org/jacoco/) for test coverage\n\n### Running\n\n* OpenApi at [localhost:8080/swagger-ui](http://localhost:8080/swagger-ui)\n\t![OpenApi](openapi.png)\n* RapiDoc at [localhost:8080/rapidoc](http://localhost:8080/rapidoc)\n\t![rapidoc](rapidoc.png)\n\nThe are various ways to run this (consult the Micronaut docs), but I've verified the following 2.\n\n#### On the JVM\n\n`./gradlew check run`\n\n#### As a Graal Native docker image\n\n- `./gradlew build assemble \u0026\u0026 ./docker-build.sh`\n- `docker run -p 8080:8080 todddo-openapi-java` (marvel at the sub 100ms start time)\n\n\n### Thoughts\n\n#### Micronaut\n\n- Haven't benchmarked, but seems to be quite quick to boot and comes with support for a *lot* of things:\n\t- OpenAPI\n\t- DI\n\t- GraalVM\n\n#### Lombok\n\n- A decent attempt at nice immutable data types, but still, not quite close to modern languages like Scala or Kotlin.\n\n#### Compile-time safety\n\n- Generally better than what I remember it to be from doing Java 10+ years ago\n- Micronaut does a great job of trying to make sure things are safe, but:\n- Things still break at runtime with certain injections and runtime-reflection based tooling, especially when running\n\tthem in Graal Native\n- Java still has a ways to go when it comes to making types ergonomic (unchecked types...)\n\n#### Graal Native\n\n- It took a lot of trial and error to get things like reflection-based tools (Jackson, DI) working *just right*, and to\nfigure out how to get Swagger resources working (refer to the `native-image.properties` file).\n\n#### Misc.\n\n- Jackson is still yucky compared to any modern JSON tool in Scala, Rust, Haskell, etc. In fact, it's even worse than\nGo because the tooling is all reflection based, which means you really have to be careful when trying to use it with\nGraal. It took me quite a while to figure out how to appease it.\n- Java is still pushing me to use Exceptions for error control flow, but you can get around it with libs like Functional\nJava.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flloydmeta%2Ftodddo-openapi-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flloydmeta%2Ftodddo-openapi-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flloydmeta%2Ftodddo-openapi-java/lists"}