JDP Science Tools

cancel
Showing results for 
Search instead for 
Did you mean: 

JSONtext: JSON Schema?

Newer version with improved info about a validation failure:

2023-11-26 17_18_17-JSON Schema Validation.vi Front Panel on JSONtext.lvproj_My Computer.png

 

 

Message 11 of 27
(1,295 Views)

Hi James,

 

thanks for the quick response. Seems to work well.

 

This does not yet validate enums (as far as I can see)
Would it be possible to add that as well?

 

Best Regards,

Stefan

0 Kudos
Message 12 of 27
(1,271 Views)
0 Kudos
Message 13 of 27
(1,259 Views)

Hi,

 

I discovered this bug with unnamed variant if it is a void variant (empty as null) using fiunction 'To JSON text.vim':

Arrowin_0-1706180019884.png

AS you can see in the output, the "testVariant" name is not displayed in the JSON data output!
Discovered using v1.8.2.122 and 1.8.1.121

 

BR,
Davy

0 Kudos
Message 14 of 27
(1,189 Views)

Hi James,

 

I would be very interested in the "Generate JSON Schema from LV Datatype" subvi. 
In the application we want to use JSON as data input to a kind of dynamic actor which defines the type of actor (load a class) and then provides parameters to the class. The JSON Schema would be generated from a cluster which is part of the class. 
A higher level web service could then also use the schema to build dynamic UIs (JSON Forms) which automatically also validate any entered data.

 

In addition to the cluster names, types and enum values, the min and max values from the data entry evaluation for numbers would also be great in order to define limits for numeric parameters. 

 

Thanks for the great library!

0 Kudos
Message 15 of 27
(1,051 Views)

Just found a (IMHO) bug in with the validation:

 

Seems it doesn't honor const definitions in a schema

 

jsonvalidator.net finds this (see screenshot attached)

 

Oli_Wachno_0-1715591962716.png

 

0 Kudos
Message 16 of 27
(807 Views)

Can you give me a complete test case (JSON, and schema that improperly passes)?  I have not been able to reproduce.

0 Kudos
Message 17 of 27
(787 Views)

I'll PM the files to you

0 Kudos
Message 18 of 27
(779 Views)

Looking at your Schema, the problem is that JSONtext doesn't (yet) support the Referencing with the "$ref" keyword.  So that "const" in the "$ref" gets ignored.   

 

Unfortunately, JSON Schema has a very large specification that I don't have the bandwidth to support.  Sorry.

 

0 Kudos
Message 19 of 27
(762 Views)

Hi James,

 

thanks for checking. Thanks for your support!

 

Oli

0 Kudos
Message 20 of 27
(752 Views)