[jax-rs-spec users] Editors Note 7.2

From: Ron Sigal <>
Date: Sat, 14 Apr 2012 23:28:35 -0400

In particular: "A ViolationException currently holds a list of
violation messages (strings) instead of ConstraintViolation to avoid a
dependency with BV. Is this sufficient?"

At first, I wanted to extend ViolationException to
ResteasyViolationException and include entire ConstraintViolations.
Thinking about it some more, though, I realized that a lot of the
information in ConstraintViolations, e.g., paths and the root bean, may
not be appropriate for client consumption. In fact, I think the
reasonable default behavior is to include just two ConstraintViolation
fields: the message and the invalid value. As per the current spec, I
turned those two fields into a single String by concatenating them,
separated by ':'. Shortly after I did that, I discovered the String

    s must have length: 3 <= length <= 5: Foo[abcdef]

in one of my unit tests. So ':' doesn't make a very good delimiter. In
fact, any character could show up in a violation message.

I'm thinking it would be nice to have something a bit richer than a
single String in the API, even something as simple as a typical Pair.


Erdös number 4.