Did something change with PropertyDescriptor validation?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Did something change with PropertyDescriptor validation?

Mike Thomsen
I have this descriptor:

    public static final PropertyDescriptor TYPE = new
PropertyDescriptor.Builder()
            .name("el5-type")
            .displayName("Type")
            .description("The type of this document (used by Elasticsearch
for indexing and searching)")
            .defaultValue("")
            .required(false)
            .expressionLanguageSupported(true)
            .build();

When I run my JUnit tests I get the following error:

  TestJsonQueryElasticsearch5.testAggregations:134 Processor has 1
validation failures:
'el5-type' validated against 'msg' is invalid because 'el5-type' is not a
supported property

But TYPE is added to the list of property descriptors and when I use
addValidator(StandardValidators.NON_BLANK_VALIDATOR) it runs just fine.

Any ideas?

Thanks,

Mike
Reply | Threaded
Open this post in threaded view
|

Re: Did something change with PropertyDescriptor validation?

Bryan Bende
Mike,

I believe this is how it always worked and is just a mis-leading
message from the mock framework.

You have to have at least one validator and you can use
Validator.VALID if you just want it to always be valid.

-Bryan


On Fri, Aug 25, 2017 at 1:33 PM, Mike Thomsen <[hidden email]> wrote:

> I have this descriptor:
>
>     public static final PropertyDescriptor TYPE = new
> PropertyDescriptor.Builder()
>             .name("el5-type")
>             .displayName("Type")
>             .description("The type of this document (used by Elasticsearch
> for indexing and searching)")
>             .defaultValue("")
>             .required(false)
>             .expressionLanguageSupported(true)
>             .build();
>
> When I run my JUnit tests I get the following error:
>
>   TestJsonQueryElasticsearch5.testAggregations:134 Processor has 1
> validation failures:
> 'el5-type' validated against 'msg' is invalid because 'el5-type' is not a
> supported property
>
> But TYPE is added to the list of property descriptors and when I use
> addValidator(StandardValidators.NON_BLANK_VALIDATOR) it runs just fine.
>
> Any ideas?
>
> Thanks,
>
> Mike
Reply | Threaded
Open this post in threaded view
|

Re: Did something change with PropertyDescriptor validation?

Matt Burgess
In reply to this post by Mike Thomsen
All properties need a validator of some kind, if you don't want to use any particular one you can add Validators.VALID.

Regards,
Matt


> On Aug 25, 2017, at 1:33 PM, Mike Thomsen <[hidden email]> wrote:
>
> I have this descriptor:
>
>    public static final PropertyDescriptor TYPE = new
> PropertyDescriptor.Builder()
>            .name("el5-type")
>            .displayName("Type")
>            .description("The type of this document (used by Elasticsearch
> for indexing and searching)")
>            .defaultValue("")
>            .required(false)
>            .expressionLanguageSupported(true)
>            .build();
>
> When I run my JUnit tests I get the following error:
>
>  TestJsonQueryElasticsearch5.testAggregations:134 Processor has 1
> validation failures:
> 'el5-type' validated against 'msg' is invalid because 'el5-type' is not a
> supported property
>
> But TYPE is added to the list of property descriptors and when I use
> addValidator(StandardValidators.NON_BLANK_VALIDATOR) it runs just fine.
>
> Any ideas?
>
> Thanks,
>
> Mike
Reply | Threaded
Open this post in threaded view
|

Re: Did something change with PropertyDescriptor validation?

Mike Thomsen
Alright, thanks. I was pulling my hair out on this one.

(This is a new ES processor that supports full JSON queries including
aggregations)

On Fri, Aug 25, 2017 at 1:48 PM, Matt Burgess <[hidden email]> wrote:

> All properties need a validator of some kind, if you don't want to use any
> particular one you can add Validators.VALID.
>
> Regards,
> Matt
>
>
> > On Aug 25, 2017, at 1:33 PM, Mike Thomsen <[hidden email]>
> wrote:
> >
> > I have this descriptor:
> >
> >    public static final PropertyDescriptor TYPE = new
> > PropertyDescriptor.Builder()
> >            .name("el5-type")
> >            .displayName("Type")
> >            .description("The type of this document (used by Elasticsearch
> > for indexing and searching)")
> >            .defaultValue("")
> >            .required(false)
> >            .expressionLanguageSupported(true)
> >            .build();
> >
> > When I run my JUnit tests I get the following error:
> >
> >  TestJsonQueryElasticsearch5.testAggregations:134 Processor has 1
> > validation failures:
> > 'el5-type' validated against 'msg' is invalid because 'el5-type' is not a
> > supported property
> >
> > But TYPE is added to the list of property descriptors and when I use
> > addValidator(StandardValidators.NON_BLANK_VALIDATOR) it runs just fine.
> >
> > Any ideas?
> >
> > Thanks,
> >
> > Mike
>