You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Caused by: java.lang.IllegalStateException: Body Metadata is immutable
at com.phoenixnap.oss.ramlplugin.raml2code.data.ApiActionMetadata.setRequestBody (ApiActionMetadata.java:350)
at com.phoenixnap.oss.ramlplugin.raml2code.data.ApiActionMetadata.collectBodyParams (ApiActionMetadata.java:173)
at com.phoenixnap.oss.ramlplugin.raml2code.data.ApiActionMetadata.parseRequest (ApiActionMetadata.java:134)
at com.phoenixnap.oss.ramlplugin.raml2code.data.ApiActionMetadata.<init> (ApiActionMetadata.java:77)
at com.phoenixnap.oss.ramlplugin.raml2code.data.ApiResourceMetadata.addApiCall (ApiResourceMetadata.java:55)
at com.phoenixnap.oss.ramlplugin.raml2code.helpers.RamlParser.checkResource (RamlParser.java:167)
at com.phoenixnap.oss.ramlplugin.raml2code.helpers.RamlParser.extractControllers (RamlParser.java:77)
at com.phoenixnap.oss.ramlplugin.raml2code.plugin.SpringMvcEndpointGeneratorMojo.generateEndpoints (SpringMvcEndpointGeneratorMojo.java:284)
at com.phoenixnap.oss.ramlplugin.raml2code.plugin.SpringMvcEndpointGeneratorMojo.execute (SpringMvcEndpointGeneratorMojo.java:527)
The text was updated successfully, but these errors were encountered:
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.
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:
The text was updated successfully, but these errors were encountered: