Validation of Modern JSON Schema: Formalization and Complexity

Author:

Attouche Lyes1ORCID,Baazizi Mohamed-Amine2ORCID,Colazzo Dario1ORCID,Ghelli Giorgio3ORCID,Sartiani Carlo4ORCID,Scherzinger Stefanie5ORCID

Affiliation:

1. Université Paris-Dauphine - PSL, Paris, France

2. Sorbonne University, Paris, France

3. University of Pisa, Pisa, Italy

4. University of Basilicata, Potenza, Italy

5. University of Passau, Passau, Germany

Abstract

JSON Schema is the de-facto standard schema language for JSON data. The language went through many minor revisions, but the most recent versions of the language, starting from Draft 2019-09, added two novel features, dynamic references and annotation-dependent validation, that change the evaluation model. Modern JSON Schema is the name used to indicate all versions from Draft 2019-09, which are characterized by these new features, while Classical JSON Schema is used to indicate the previous versions. These new “modern” features make the schema language quite difficult to understand and have generated many discussions about the correct interpretation of their official specifications; for this reason, we undertook the task of their formalization. During this process, we also analyzed the complexity of data validation in Modern JSON Schema, with the idea of confirming the polynomial complexity of Classical JSON Schema validation, and we were surprised to discover a completely different truth: data validation, which is expected to be an extremely efficient process, acquires, with Modern JSON Schema features, a PSPACE complexity. In this paper, we give the first formal description of Modern JSON Schema, which we have discussed with the community of JSON Schema tool developers, and which we consider a central contribution of this work. We then prove that its data validation problem is PSPACE-complete. We prove that the origin of the problem lies in the Draft 2020-12 version of dynamic references, and not in annotation-dependent validation. We study the schema and data complexities, showing that the problem is PSPACE-complete with respect to the schema size even with a fixed instance but is in P when the schema is fixed and only the instance size is allowed to vary. Finally, we run experiments that show that there are families of schemas where the difference in asymptotic complexity between dynamic and static references is extremely visible, even with small schemas.

Funder

Deutsche Forschungsgemeinschaft

European Union

Ministero dell'Università e della Ricerca

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference29 articles.

1. 2023. Ajv JSON Schema validator. https://ajv.js.org Retrieved 10 January 2023.

2. 2023. Hyperjump JSON Schema Validator. https://json-schema.hyperjump.io/ Online tool. Retrieved 10 January 2023.

3. 2023. JSON Schema validators. https://json-schema.org/implementations.html##validators Retrieved 10 January 2023.

4. Henry Andrews. 2023. Modern JSON Schema. Available online at https://modern-json-schema.com/

5. Witness Generation for JSON Schema

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3