
Milestone
SDK [2.0.0-RELEASE]
2.0.0-RELEASE marks a pivotal milestone for ApiHug, introducing breaking changes designed to establish a next-generation, Large Language Model (LLM)-friendly API specification and tooling ecosystem.
2.0.0-RELEASE⚠️⚠️⚠️ Do NOT upgrade to Spring Boot 4.0 or later (as of December 2025) — the current SDK is not yet compatible with the breaking changes introduced in Spring Boot 4.0. ⚠️⚠️⚠️
Forcing an upgrade may result in obscure build or runtime errors that severely impact development velocity.
For details on Spring Boot 4.0 breaking changes, refer to the official migration guide:
Spring Boot 4.0 Migration Guide
oneof syntax.allOf to flatten and simplify response wrappers.Refer to: apihug-demo/libs.versions.toml
{PROJECT_ROOT}/gradle/libs.versions.toml, update apihug = "1.0.0-RELEASE" to 2.0.0-RELEASE or higher.1.0.0+:3.8.x series due to breaking changes in Spring Boot 4.0.wire or stub commands are no longer needed.src/generated) are read-only and managed entirely by ApiHug tooling.
.proto contracts or generator configuration instead.java, proto, etc.) contain developer-authored code and schemas.
src/main/java..proto files) belong in src/main/proto.{module}/
├── src/main/
│ ├── proto/ → Handwritten .proto definitions
│ │ └── {package_name}/
│ │ ├── api/ → API contracts
│ │ ├── domain/ → Domain entities
│ │ └── infra/ → Infrastructure (enums, errors)
│ ├── java/ → Handwritten business logic
│ ├── trait/ → Repository extensions
│ └── resources/
│ └── hope-wire.json → Module configuration
├── src/generated/main/ → Generated code (read-only)
│ ├── api/ → API interfaces
│ ├── domain/ → Domain models
│ ├── wire/ → DTOs
│ ├── mcp/ → Microservice contracts
│ └── cloud/ → Cloud adapters
├── src/test/
│ ├── java/ → Unit/integration tests
│ └── trait/ → Test extensions
└── src/generated/test/ → Generated test code (read-only)
├── api/ → Contract-based API tests
└── ...
Gradle conventions:
src/generated/main are added to sourceSets.main.java.srcDirs and compiled as part of the main Java sources.src/main/proto is registered as a resource directory (sourceSets.main.resources.srcDir) so .proto files are available at build time.src/test-kola)Kola enables contract-based end-to-end testing via a dedicated source set and task:
src/
main/
java/ // Production Java source code
resources/ // Production resources
test/
java/ // Standard unit and integration tests (e.g., JUnit)
resources/ // Test resources for standard tests
test-kola/
java/ // Auto-generated Java test classes (compiled and executed)
groovy/ // Groovy DSL scripts (treated as resources; not compiled)
resources/ // Additional test assets (contracts, sample data, configurations, etc.)
Gradle defines a testKola source set:
src/test-kola/java: Contains generated test classes.src/test-kola/groovy and src/test-kola/resources: Registered as resource directories.testKola classpath includes outputs from both main and test, enabling reuse of utilities and base classes.A dedicated testKola Gradle task runs only Kola-generated tests (via JUnit Platform). The default test task also uses JUnit Platform for consistency.
src/generated—update source contracts and regenerate instead.src/main/java and tests in src/test/java for clarity.src/main/proto and Kola DSL scripts in src/test-kola/groovy to avoid mixing concerns../gradlew test for standard tests and ./gradlew testKola for contract validation—this enables layered execution and easier debugging.As of SDK 2.1.4-RELEASE, the stub module has been merged into the main module. There is no longer a separate stub module or command.
// Old paths
import "extend/version.proto";
import "swagger/annotations.proto";
import "extend/domain.proto";
// New paths
import "apihug/protobuf/extend/version.proto";
import "apihug/protobuf/swagger/annotations.proto";
import "apihug/protobuf/extend/domain.proto";
oneof (mapped to OpenAPI allOf)internal, external, hidewire projects support the protoImport syntax for including third-party Protobuf dependencies.stub should now use wireImport to declare Wire module dependencies.implementation instead of wireImport will not cause a build error but will result in empty stub generation.😆 Quick Start Guides: