Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
JSON Schema validator
This is script for Godot Engine, that validate JSON files by JSON Schema.
Supported Engine Version
3.1
Version String
1.1
License Version
MIT
Support Level
community
Modified Date
4 years ago
Git URL
Issue URL
JSON-Schema-validator
This is script for Godot Engine, that validate JSON files by JSON Schema.
How to use
- Create new
JSONSchema
object in your script (this script automatically register class in Godot ClassDB). Call its functionvalidate(json_data, json_schema)
wherejson_data
- is your data in string format;json_schema
- is your json_schema in string format. - Use helper class. Create new
JSONFile
object, open it as it described in ancestorFile
class (and don't forget to close afterall!) useschema_validator
field to asigh validator class instance, usejson_schema
field to assign schema string, use functionsload_data()
andsave_data()
to work with your files.
Example:
var jf := JSONFile.new()
jf.schema_validator = JSONSchema.new()
jf.json_schema = to_json(some_schema_dictionary)
jf.open("user://some_data.txt", File.WRITE)
my_data = jf.load_data() #if my_data turned to String, check if it is error message
jf.close()
Links
More about schemas and validation here: https://json-schema.org
This is script for Godot Engine, that validate JSON files by JSON Schema.
Reviews
Quick Information
JSON Schema validator
This is script for Godot Engine, that validate JSON files by JSON Schema.
Supported Engine Version
3.1
Version String
1.1
License Version
MIT
Support Level
community
Modified Date
4 years ago
Git URL
Issue URL