[bv-dev] Changes in BV XML schemas

Gunnar Morling gunnar at hibernate.org
Sun Jun 10 12:16:38 EDT 2012


Hi all,

I'd be interested in your opinion on BVAL-295 [1].

The background is that for BV 1.1 there will be some additions to the
BV XML descriptors and thus the corresponding XSD files (e.g. new
element "parameter-name-provider" in validation.xml).

While implementing method validation within the RI, Hardy and I asked
ourselves whether there should be an explicit version attribute in the
descriptor root element (similar e.g. to JPA's persistence.xml):

<validation-config
    xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
    xmlns:xsi="..."
    xsi:schemaLocation="..."
    version="1.1">
    ...
</validation-config>

This attribute would have a fixed value defined in the schema, which
would allow to unambiguously identify the BV version for which an XML
descriptor was written.

As long as all schema changes are backwards compatible (meaning any
files written against the 1.0 schemas are also valid against the new
schemas), there is not really the need for such a version attribute,
as always the new schema files could be used for validation. Things
look different, though, in case of incompatible changes. Then the
schema to validate against could be determined using the version
attribute.

Personally I feel we should add such an attribute once we really have
an incompatible change (maybe in a future BV revision), but maybe
there are other opinions?

--Gunnar

[1] https://hibernate.onjira.com/browse/BVAL-295


More information about the beanvalidation-dev mailing list