ADR-003: @EnableWebMvc on core, portfolio and webservice
Status: Accepted (origin not recorded; documented 2026-11-06)
Context
Three services — core, portfolio, webservice — declare @EnableWebMvc on their application class. The other four rely on Spring Boot's WebMvcAutoConfiguration.
@EnableWebMvc imports the full MVC configuration and switches Boot's web auto-configuration off for that context: message converters, static resource handling, path matching, CORS and the auto-configured documentation endpoints are no longer decided by Boot. The service owns them.
Decision
The three services keep explicit MVC control. Their JSON/documentation setup is configured by hand and is deliberately not uniform with the other four.
Alternatives considered
- Drop
@EnableWebMvceverywhere and let Boot auto-configure. Considered during the July 2026 dependency cleanup and rejected as a separate change: it alters converter and documentation behaviour in three production services at once. - Keep it only where a custom converter exists. Would be the right long-term shape, but "which service truly needs it" is not documented and the answer differs per service.
Consequences
- MVC behaviour is not uniform across services. A converter, a documentation endpoint or a path-matching rule that works in
workermay not work inwebservice. Check the service, not the platform. - The springdoc autoconfigure excludes in these services are load-bearing. Removing them once turned
/glacez-docsinto a406 Ambiguous search mapping detected— because thespring-data-restjars arrived throughglacez-lib-utilsand theirfindByUser(Sort)/findByUser(Pageable)methods collided in the generated schema. A green build does not prove the docs endpoint still works: boot the service. - Adding a JSON customisation (Jackson 3 converters, for instance) has to be registered explicitly here, where a Boot-only service gets it from the starter.
Related
webservicealso carries three hand-written Jackson converters and is the only WAR (see ADR-004).