[WIP] Units, ammo and tools JSON validation schema

Discussion in 'Mod Discussions' started by exterminans, June 3, 2014.

  1. exterminans

    exterminans Post Master General

    Likes Received:
    Since the game isn't exactly verbose about errors, I decided to to create a generic JSON Schema (See: http://json-schema.org/) which allows to validate the structure the JSON files with a validator of your choice and possibly even grants autocompletion when working with tools such as Visual Studio.
    Can also be used as a plain reference if you prefer that.

    1. Collecting all properties used (70%)
    2. Structure properties and create basic schema (20%)
    3. Determine conditional and optional properties. (10%)
    4. Document the exact meaning of each property. (0%)
    5. Find default values for optional properties. (1%)
    6. Make schema strict. (0%)
    It will not be possible to use the schema for actual validation until steps 1, 2 and 3 have been completed. File attached reflects the current state.

    • "base_spec" property isn't exactly supported by any validator. In order to validate the JSON file, the base file needs to be merged first. The schema only matches a fully expanded JSON file.
    • Paths denoted in the JSON file can't be checked automatically. You must still manually verify that the path to resource files are correct.
    • Will only work for ammunition, tools (build arms, weapons) and units (incl. structures) since they are very similar.
      Additional schemas are required to work with animation trees, planet features etc.
    Informations from the following 2 threads will be merged eventually:

    Attached Files:

  2. wondible

    wondible Post Master General

    Likes Received:

Share This Page