Open techpavan opened 5 years ago
Yeah, multiple request's media types are not supported. That's why I'm marking this as an enhancement.
Unfortunately, supporting this is not going to be very easy. We should be generating one method for every media type of request. In your example, we should generate a method that receives Email
and another for Sms
. This should be done for all rules.
Can you please consider a PR?
Not sure if I can find time to take a deep dive and come up with PR in my current occupancy. But do share some hints on classes and methods that are closely involved and I can try to see if I could attempt.
Provided below is a RAML which is valid and parsed well by other tools. But when we try to generate Java code, it fails with the exception provided at the bottom. The below method could be represented in the controller as
public Single<ResponseEntity<?>> createMessage(Object object, HttpHeaders httpHeaders)
where the implementer owns the responsibility on how to respond.If the below RAML is slightly changed by removing the request body and support multiple response types, only the first one gets picked for code generation and that too is incorrect.
Please see if these could be handled better.
Reproducer: https://github.com/techpavan/springmvc-raml-plugin-issues/tree/master/2
Exception thrown: