2016-08-24 21:56 GMT+04:00 J. Fiala <[email protected]>:

> Sergey,
>
> Exactly, this plugin provides the beanvalidation annotations for
> complextypes at the client + server side, making BeanValidation possible on
> both sides.
>
> What is missing so far:
>
> 1.) Necessary: Add a switch to wadl2java to allow adding @Valid to the
> method + parameters for generated methods, to enable automatic validation
>
> 2.) Nice to have: Add BeanValidation annotation support to
> wadl2java/SourceGenerator.java for the query parameters
> These are currently not covered by the krasa-jaxb-tools, as they seem to
> be handled completely separate from the JAXB processing.
> see  https://github.com/apache/cxf/pull/146/files, SourceGenerator.java
> where I added @NotNull support;
> Adding support for the others would require access to the complextypes of
> the schema.
> If you give me a hint how to access these effectively I can add the other
> ones as well.
>
> However, I'll try the schema validation approach as well, but I think it
> would be nice to have both options available and leave it up to the
> developer.
>
>
about 2) , it would be great, if, in example we have
<param name="uid" type="core:UUIDType" style="template">

(
https://github.com/ilb/jparestresource/blob/master/jparestresource-api/src/main/resources/schemas/jparestresource/jparestresource.wadl
)

where  core:UUIDType is
    <xsd:simpleType name="UUIDType">
        <xsd:annotation>
            <xsd:documentation>Universally Unique
Identifier</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:length value="36"/>
            <xsd:pattern
value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
        </xsd:restriction>
    </xsd:simpleType>

Then annotations like
@Valid
@Size(min = 36,max = 36)
@NotNull
@Pattern(regexp = "
[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}")

would be generated on param in interface method

Reply via email to