Re: Bean Validation for Meecrowave JSON-B/JAX-RS

2017-08-07 Thread John D. Ament
JAX-RS Defines Bean Val integration, if you add @Valid to resource methods
(params and return value) they should get validated on the way in or the
way out.

On Mon, Aug 7, 2017 at 8:16 AM Mark Struberg 
wrote:

> Hi!
>
> Not sure whether I should post this in Johnzon, CXF or here.
>
> My colleagues have the following question:
> They would like to have an e.g. @NotNull field in a data structure which
> gets serialised as @Produces(MediaType.APPLICATION_JSON)
>
> Means JAX-RS uses JSON-B for serialisation. Ond of course it should also
> work for @Consumes
>
> Obviously this does _not_ work right now, simply because neither JSON-B
> nor JAX-RS defines any Bean Validation integration, right?
>
> Now my question: where in the stack would it make the most sense to
> integrate it? I assume in JSON-B, isn't?
>
> Any thoughts?
>
> LieGrue,
> strub


Re: Bean Validation for Meecrowave JSON-B/JAX-RS

2017-08-07 Thread Romain Manni-Bucau
Hi Mark,

it should work just adding a bval impl (see
https://github.com/apache/meecrowave/blob/trunk/integration-tests/beanvalidation/src/main/java/org/apache/meecrowave/beanvalidation/itest/Service.java)
since it is object based


Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | JavaEE Factory


2017-08-07 14:16 GMT+02:00 Mark Struberg :

> Hi!
>
> Not sure whether I should post this in Johnzon, CXF or here.
>
> My colleagues have the following question:
> They would like to have an e.g. @NotNull field in a data structure which
> gets serialised as @Produces(MediaType.APPLICATION_JSON)
>
> Means JAX-RS uses JSON-B for serialisation. Ond of course it should also
> work for @Consumes
>
> Obviously this does _not_ work right now, simply because neither JSON-B
> nor JAX-RS defines any Bean Validation integration, right?
>
> Now my question: where in the stack would it make the most sense to
> integrate it? I assume in JSON-B, isn't?
>
> Any thoughts?
>
> LieGrue,
> strub


Bean Validation for Meecrowave JSON-B/JAX-RS

2017-08-07 Thread Mark Struberg
Hi!

Not sure whether I should post this in Johnzon, CXF or here. 

My colleagues have the following question: 
They would like to have an e.g. @NotNull field in a data structure which gets 
serialised as @Produces(MediaType.APPLICATION_JSON)

Means JAX-RS uses JSON-B for serialisation. Ond of course it should also work 
for @Consumes

Obviously this does _not_ work right now, simply because neither JSON-B nor 
JAX-RS defines any Bean Validation integration, right?

Now my question: where in the stack would it make the most sense to integrate 
it? I assume in JSON-B, isn't?

Any thoughts?

LieGrue,
strub

[jira] [Commented] (OWB-1208) Unable to use Unmanaged with mixed CDI 2.0/1.1 bean archives

2017-08-07 Thread John D. Ament (JIRA)

[ 
https://issues.apache.org/jira/browse/OWB-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16116393#comment-16116393
 ] 

John D. Ament commented on OWB-1208:


The CXFCdiServlet is just an example.  I actually had been using Unmanaged to 
create the behavior of injecting into fields without creating a proxy.  

> Unable to use Unmanaged with mixed CDI 2.0/1.1 bean archives
> 
>
> Key: OWB-1208
> URL: https://issues.apache.org/jira/browse/OWB-1208
> Project: OpenWebBeans
>  Issue Type: Bug
>Reporter: John D. Ament
>
> Take for instance the Apache CXF CDI Extension.  There's a `CXFCdiServlet` 
> class which has no bean defining annotations, but has a valid CDI 1.1 
> [beans.xml|https://github.com/apache/cxf/blob/master/integration/cdi/src/main/resources/META-INF/beans.xml].
>   If I start OWB from a main that has CDI 2.0's trimmed bean archive, this 
> servlet is not available as a CDI bean, and hence cannot be used within 
> Unmanaged.
> I'm not sure if the solution is that it should be a CDI bean, or if Unmanaged 
> should be able to look at non-beans.  This issue does not replicate on Weld 3.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)