Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json Schema validator can't find the type mismatch error with sting in INT field #34

Open
blag001 opened this issue Sep 11, 2020 · 7 comments

Comments

@blag001
Copy link

blag001 commented Sep 11, 2020

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

@jlolling
Copy link
Owner

jlolling commented Oct 8, 2020

This is intentionally done because a lot of documents are not that strict in using " only for text values.

@blag001
Copy link
Author

blag001 commented Oct 19, 2020

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) ?

@jlolling
Copy link
Owner

I will check the current implementation and try to use optional a more strict method.

@blag001
Copy link
Author

blag001 commented Sep 22, 2021

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

@jlolling
Copy link
Owner

Indeed, I was distracted from solving this issue. I will check that this week.

@jlolling
Copy link
Owner

I need to update the validation engine and the idea is to create a dedicated component for validating.

@jlolling
Copy link
Owner

jlolling commented Nov 16, 2021

I am going to introduce a new validation engine. I hope this new version will solve you issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants