mapeditor/tiled




Do you want to work on this issue?
You can request for a bounty in order to promote it!
Create JSON Schema for Tiled json format #4096
krychu posted onGitHub
Is your feature request related to a problem? Please describe.
- Get up-to-date C parser for tiled json files. Not sure which C parsers are up-to-date, whether they read all or some part of the file etc.
Describe the solution you'd like
- Create (and maintain) official JSON Schema and then use quicktype to generate C code.
- Note that code can be generated for over 20 languages
Describe alternatives you've considered
- Three C libraries linked to in docs.
Additional notes
- Such approach is provided by ldtk here which I tested and works well
- Dedicated library might have more ergonomic API. The generated parser, for example, uses list to iterate over multiple elements (
list_get_head(ldtk->levels)
) instead of regular array access - JSON Schema can contain description for various data which is later added to the code in form of comments.
- JSON Schema could be used to generate documentation, example: here, and here
- JSON Schema could be converted to XSD schema (if needed): here
- There are tools to generate JSON Schema from json file, which could serve as a starting point: here
Documentation of the json format has to exist in some form: html, markdown or JSON schema. Moving to adopting JSON schema might thus potentially be only one off cost.