Hey guys I'm using javax bean validations in dropw...
# server
m
Hey guys I'm using javax bean validations in dropwizard and I'm getting badly formatted error messages. Anyone bumped into this or have a clue what (and if) I'm doing something wrong?
Copy code
{
  "errors": [
    "updateAddress.arg1.county must not be empty"
  ]
}
d
Please provide more context
m
What would you like to know?
Here's my bean:
Copy code
data class MyBean(
@field:NotEmpty val county: String? = null,
...
)
d
And your resource class?
m
My resource implements an interface that contains the
@Valid
annotation on the body parameter.
Concrete implmentation does not specify the annotation
Examples:
Copy code
interface MyApi {
  fun update(@Valid updateAddress: MyBean): SomeResponse
}

class Resource: MyApi {
  override fun update(updateAddress: MyBean): SomeResponse { ... }
}
d
So is it the "arg1" in the error that you don't want?
m
Yes
d
What JVM version are you on?
m
Not sure what you mean? JDK 1.8
d
Yeah. I found this that might interest you: http://www.hackerav.com/?post=22460
m
Thanks but it's not what I was looking for
I was looking for something like ExceptionMapper. Thanks for the help!
d
Alright 😉