Json Schema validator can't find the type mismatch error with sting in INT field
Hello, I'm using the 16.2 build and encounter a bug : When using this simple Json schema
{
"type": "object",
"properties": {
"ID": {
"type": "integer"
}
}
}
I'm able to validate this JSON : {"ID" : "2"}
But as explained here https://json-schema.org/understanding-json-schema/reference/numeric.html#integer the sting "2" should not be valid.
I think it's a bug in the validator engine, did you know if there is a way to patch it ? Thank in advance, Bests Regards
This is intentionally done because a lot of documents are not that strict in using " only for text values.
Understood, but sadly we use strict typing... (and same go for online Json validator).
Maybe adding a checkbox to enable a "strict type" on the Json schema check (used on tOpen & tSave if I remember) ?
I will check the current implementation and try to use optional a more strict method.
Hello Jan, Did you have any update on this problem ? It's still bothering us a lot sadly :/
I take a look, so far it seem it's this line https://github.com/jlolling/talendcomp_tJSONDoc/blob/master/src/main/java/de/jlo/talendcomp/json/TypeUtil.java#L188 But I'm not confident enough to try messing around... Kinds regards
Indeed, I was distracted from solving this issue. I will check that this week.
I need to update the validation engine and the idea is to create a dedicated component for validating.
I am going to introduce a new validation engine. I hope this new version will solve you issue.