Following is my application configuration
@SpringBootApplication
class DemoApplication {
static void main(String[] args) {
SpringApplication.run(DemoApplication, args)
}
@Bean
IntegrationFlow startHeatToJiraFlow() {
IntegrationFlows
.from(WebFlux.inboundGateway("/input1")
.requestMapping { m -> m.methods(HttpMethod.POST).consumes(MediaType.APPLICATION_JSON_VALUE) }
.requestPayloadType(ResolvableType.forClassWithGenerics(Mono, ServiceInput))
)
.channel("inputtestchannel")
.get()
}
@ServiceActivator(inputChannel = "inputtestchannel")
Map replyMessage() {
return [success: true]
}
class ServiceInput {
@NotBlank
String input1
@NotBlank
String input2
}
}
I expect the following curl request to give me an error since I am not giving an input JSON in the body.
curl -X POST localhost:8080/input1 -H "Content-Type:application/json"
Instead I am receiving a 200 response
{"success":true}
What am I doing wrong here ?