eclipsesource/play-json-schema-validator

array type

Closed this issue · 4 comments

Hi! I'm playing with this validator at http://play-json-schema-validator.herokuapp.com/

When schema is:

{
  "type": "array"
}

and json instanse:
[1,2,3]

I get strange validation error:

[
    1,
    2,
    3,
    1,
    2,
    3
]

What am i doing wrong? I just want to check that json is an array

Hi,
thanks for the report! This is not an error of the validator itself but of the web front-end. Therefore I created an issue for it here.
I'll try to fix this soon. Thanks again!

Aaa, that's good, i was afraid that's a bug. I've started to use this validator since today and it seems like it works as expected :) I was trying to find such a lib but wasn't successful till yesterday. There's a java lib but it has no maintainer and it's not scala anyway. I was really surprised that there are so many implementation even in javascript, but coudn't find java/scala :) Thanks for job!

Thanks for the kind words!
Unfortunately, after a little bit of more debugging today, I also found an error in the lib itself which only applies when merging error information for arrays. The validation result is OK though (this is what the frontend reports incorrectly), it's only the duplicate items that result due to an error within the merge.
I'll update the web frontend as well the library (0.6.5) until the end of this week.

Fixed with 0.6.5.