JDP Science Tools

annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

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

 

 

Messaggio 11 di 27
2.647Visualizzazioni

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
Messaggio 12 di 27
2.623Visualizzazioni
0 Kudos
Messaggio 13 di 27
2.611Visualizzazioni

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
Messaggio 14 di 27
2.541Visualizzazioni

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
Messaggio 15 di 27
2.403Visualizzazioni

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
Messaggio 16 di 27
2.159Visualizzazioni

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

0 Kudos
Messaggio 17 di 27
2.139Visualizzazioni

I'll PM the files to you

0 Kudos
Messaggio 18 di 27
2.131Visualizzazioni

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
Messaggio 19 di 27
2.114Visualizzazioni

Hi James,

 

thanks for checking. Thanks for your support!

 

Oli

0 Kudos
Messaggio 20 di 27
2.104Visualizzazioni