Recent

Author Topic: JSON Schema  (Read 4810 times)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
JSON Schema
« on: March 04, 2014, 02:52:21 am »
Is there an offline way to validate JSON data against some JSON schema?
http://json-schema.org/documentation.html
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: JSON Schema
« Reply #1 on: March 04, 2014, 12:21:57 pm »
Hmm, if I look at that site, it already makes the classic US-centric mistake in the address schema, by making region required, like a billion stupid websites.

This is not an universal requirement,  in the Netherlands (and Belgium, and I assume many smaller countries), addresses that are basically street - number - postal code - muncipality ( - country) without a level between municipality and country. Even larger federal states as Germany don't.


avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: JSON Schema
« Reply #2 on: March 05, 2014, 03:19:43 pm »
If you are talking about the Address example from their Standard Schema samples, then the way I understand it, it is just a sample schema and not some general addressing standard. But it shows that we can define how our JSON data should look like (Americans will probably use something like that sample, others will probably want to modify it), and we can validate our JSON data against some schema (in this case our Address sample schema).

That is what I am looking for. A way to validate JSON data against some JSON schema. Some validator libraries can be found here: http://json-schema.org/implementations.html, but nothing for Pascal. Simplest libraries compare entered JSON data against JSON schema and report data input error as a true/false function result. Then if you want to dig deeper you can examine error structure (usually also JSON data). There are even online validators like this one: http://json-schema-validator.herokuapp.com.

If validation against schema does not exist in FPC/Laz/CT, then is there any lib/unit that can validate JSON data in some other way?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

FedorKolmykow

  • Newbie
  • Posts: 1
Re: JSON Schema
« Reply #3 on: November 13, 2020, 12:16:31 pm »
The question remains relevant. Is there anything that allows you to validate JSON data?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: JSON Schema
« Reply #4 on: November 19, 2020, 10:25:00 pm »
The question remains relevant. Is there anything that allows you to validate JSON data?
Not from my quick googling. Freel free to make one.

 

TinyPortal © 2005-2018