0

I'm evaluating enunciate to document our REST APIs and I'm having an issue with the validation step:

Validation result has errors.
my.java: error: [core] An entity parameter must be of type MultivaluedMap<String, String> if there is another parameter annotated with @FormParam.
                            @FormParam("my-param") String myParam, String data)

This construct of accepting the POST data as a String entity in addition to @FormParam bindings is supported by Jersey, so not sure why enunciate is choking on it? Is this not JAX-RS compliant?

This is a really useful to capture the full post data for auditing purposes if something went wrong. Is there a way to configure enunciate to ignore this argument?

If not, is there some other way to capture the post data in a way that would keep enunciate happy? I'm reluctant to go to MultivaluedMap as the stringification process may not result in exactly the String which was passed in...

Thanks!

TheArchitect
  • 2,161
  • 1
  • 12
  • 16

1 Answers1

0

It may be that the validation checks Enunciate performs are outdated. You might consider requesting a change by submitting a JIRA issue.

One thing you could try as a workaround is to create your own custom parameter annotation and configure Enunciate consider it as a custom resource parameter.

 <enunciate>
   ...
   <services>
     <rest>
       <custom-resource-parameter-annotation qualifiedName="org.myco.CustomResourceParam"/>
     </rest>
   </services>
   ...
 </enunciate>

However, if the purpose of the parameter is for auditing, I'd really recommend using a Jersey filter. That way you don't litter your API code with auditing concerns.

Ryan Heaton
  • 1,173
  • 7
  • 11