JSON

Leonid Mamchenkov: Validating JSON against schema in PHP

字号+ 作者:H5之家 来源:H5之家 2017-03-21 08:00 我要评论( )

Leonid Mamchenkov: Validating JSON against schema in PHP,InthisnewposttohissiteLeonidMamchenkovtalksaboutvalidatingJSONcontentsenttoyourapplicationtoe

In this new post to his site Leonid Mamchenkov talks about validating JSON content sent to your application to ensure it matches a JSON schema definition.

GitHub was rather slow yesterday, which affected the speed of installing composer dependencies (since most of them are hosted on GitHub anyway). Staring at a slowly scrolling list of installed dependencies, I noticed something interesting.

Of course, I’ve heard of the seld/jsonlint before. It’s a port of zaach/jsonlint javascript tool tophp, written by Jordi Boggiano , aka Seldaek, the genius who brought us composer dependency manager and packagist.org repository.

But JSON schema? What’s that?

From there he gets into a high level definition of what JSON schema is and the similarities it has to XML's structure. He then links to a PHP package that can help with the validation and how to use it (defining a simple JSON file, a schema and the code to perform the evaluation).

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • php浅析json_encode、json_decode 用法示例

    php浅析json_encode、json_decode 用法示例

    2017-03-19 08:03

  • 【那些技术】php的serialize序列化和json性能测试(上)

    【那些技术】php的serialize序列化和json性能测试(上)

    2017-03-18 09:01

  • PHP数组编码转换(UTF8/GBK/json_encode)

    PHP数组编码转换(UTF8/GBK/json_encode)

    2017-03-16 17:01

  • php封装json通信接口详解及实例

    php封装json通信接口详解及实例

    2017-03-16 16:04

网友点评