mapeditor / mapeditor/tiled

Create JSON Schema for Tiled json format

Open
#4,096 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

**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](https://app.quicktype.io/?utm_source=awesome-jsonschema) 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](https://ldtk.io/docs/game-dev/loading/#2-the-quicktype-way) 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](https://github.com/adobe/jsonschema2md), and [here](https://github.com/coveooss/json-schema-for-humans)
- JSON Schema could be converted to XSD schema (if needed): [here](https://www.convertsimple.com/convert-json-schema-to-xsd/)
- There are tools to generate JSON Schema from json file, which could serve as a starting point: [here](https://www.jsonschema.net/)

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Tiled JSON-format documentation and the three C libraries linked in the issue, then compare their coverage with the format. Done means an official, maintained JSON Schema exists and can serve as the basis for generating C code and format documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, json
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.