How ashif-ismail/spring-auto-request-parser works
Project type and purpose
• This is a Spring Boot “starter” library (open-source tool) that provides zero-config auto-configuration for custom MVC argument resolution. It hooks into Spring’s startup process (via spring.factories) and automatically registers a HandlerMethodArgumentResolver that resolves controller method parameters annotated with @RequestContent.
File structure
• Top-level configuration:
• pom.xml / mvnw – Maven build, publishing via GitHub Actions (.github/workflows/maven-publish.yml).
• src/main/resources/META-INF/spring.factories – declares WebAutoConfig for Spring Boot auto-configuration.
• Code packages:
• com.ashifismail.autorequest.config.WebAutoConfig – the Spring @Configuration that registers the resolver.
• com.ashifismail.autorequest.web.RequestContent – the marker annotation.
• com.ashifismail.autorequest.web.RequestContentArgumentResolver – the core logic that inspects requests and binds JSON/XML/body content to method parameters.
README for additional insights
• Confirms “zero configuration” design, plug-and-play setup, and use of a single annotation to trigger the resolver.
Main components & relationships
a. External HTTP Client (curl/browser/SDK)
b. Spring MVC DispatcherServlet (framework entry point)
c. HandlerMapping & HandlerAdapter (Spring core)
d. WebAutoConfig (auto-configuration)
e. RequestContentArgumentResolver (custom resolver)
f. HttpMessageConverters (JSON/XML converters)
g. User’s Controller & @RequestContent method parameter
h. Domain object (POJO) bound from request body
i. Response generation back to HTTP Client
Interaction flow:
1) Client sends HTTP request → 2) DispatcherServlet routes to controller →
3) HandlerAdapter invokes WebAutoConfig-registered RequestContentArgumentResolver →
4) Resolver reads annotation, picks appropriate HttpMessageConverter →
5) Body → Domain object → Controller method → 6) Return value serialized → HTTP response.
Architectural patterns & design principles
• Spring Boot Auto-Configuration (via spring.factories) for zero config.
• Strategy pattern: custom HandlerMethodArgumentResolver plugged into Spring’s resolver chain.
• Annotation-driven programming model.