Validate Game Data

Checks the game data for validity and produces a report.

The exit code will be 1 if the report contains errors and the --output is set to err. Otherwise, the exit code will be 0.

Command

# local game data (windows)
Charon.exe DATA DELETE --dataBase "c:\my app\gamedata.json" --schema Item --id "Sword"

# remote game data
Charon.exe DATA DELETE --dataBase "https://charon.live/view/data/My_Game/develop/" --schema Item --id "Sword" --credentials "<API-Key>"

Parameters

--dataBase

Absolute or relative path to game data. Use quotation marks if your path contains spaces.

# local file
--dataBase "c:\my app\gamedata.json"

# remote server
--dataBase "https://charon.live/view/data/My_Game/develop/"
--credentials

The API key used to access remote server in case of –dataBase being URL.

--validationOptions

List of validation checks and repairs to perform.

# repairs
--validationOptions repair
--validationOptions deduplicateIds
--validationOptions repairRequiredWithDefaultValue
--validationOptions eraseInvalidValue

# checks (default)
--validationOptions checkTranslation
--validationOptions checkRequirements
--validationOptions checkFormat
--validationOptions checkUniqueness
--validationOptions checkReferences
--validationOptions checkSpecification
--validationOptions checkConstraints
--output

Path to a validation report file. If the file exists, it will be overwritten. The directory must already exist. Alternatively, you can output to Standard Error, Standard Output, /dev/null, or a URL.

# standart output
--output out
--output con

# standart error
--output err

# null device (default)
--output null

# absolute path (windows)
--output "c:\my app\document.json"

# absolute path (unix)
--output /user/data/document.json

# relative path (universal)
--output "./document.json"

# remote location (HTTP)
--output "http://example.com/document.json"

# remote location with authentication (FTP)
--output "ftp://user:password@example.com/document.json"
--outputFormat

Format of exported data.

# JSON (default)
--outputFormat json

# BSON
--outputFormat bson

# Message Pack
--outputFormat msgpack

# XML
--outputFormat xml
--outputFormattingOptions

Additional options for specified format.

This command supports universal parameters.

Output Data Schema

The report follow this pattern:

{
  records:
  [
    {
      id: "<document-id>",
      schemaId: "<schema-id>",
      schemaName: "<schema-name>",
      errors: // could be null if no errors
      [
        {
          path: "<path-in-document>",
          message: "<error-message>",
          code: "<error-code>"
        },
        // ...
      ]
    },
    // ...
  ]
}

or JSON schema:

{
  "type": "object",
  "x-name": "ValidationReport",
  "additionalProperties": false,
  "properties": {
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "x-name": "ValidationRecord",
        "additionalProperties": false,
        "properties": {
          "id": { },
          "schemaName": {
            "type": "string"
          },
          "schemaId": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "x-name": "ValidationError",
              "additionalProperties": true,
              "readOnly": true,
              "properties": {
                "path": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "metadataHashCode": {
      "type": "integer",
      "format": "int32"
    }
  }
}