{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "project_id": {
      "description": "ID of the project",
      "type": "string"
    },
    "file_format": {
      "description": "File format name. See the format guide in the documentation for all supported file formats.",
      "type": "string",
      "default": "yml"
    },
    "locale_id": {
      "description": "Locale that should be downloaded. Locale ID or locale name are valid options",
      "type": "string"
    },
    "encoding": {
      "description": "Enforces a specific encoding on the file contents. Valid options are \"UTF-8\", \"UTF-16\" and \"ISO-8859-1\"",
      "type": "string",
      "default": "UTF-8"
    }
  },
  "id": "https://json.schemastore.org/phraseapp.json",
  "properties": {
    "phraseapp": {
      "description": "Root element of the PhraseApp config",
      "type": "object",
      "properties": {
        "defaults": {
          "description": "Default configuration for API endpoints",
          "type": "object",
          "properties": {
            "keys/list": {
              "type": "object",
              "properties": {
                "sort": {
                  "type": "string",
                  "default": "updated_at"
                },
                "order": {
                  "type": "string",
                  "default": "desc"
                }
              }
            }
          }
        },
        "host": {
          "description": "API host URL. Only needs to be changed for OnPremise usage",
          "type": "string"
        },
        "access_token": {
          "description": "Access Token for authorization. Can be created in the user profile",
          "type": "string"
        },
        "file_format": {
          "$ref": "#/definitions/file_format"
        },
        "project_id": {
          "$ref": "#/definitions/project_id"
        },
        "push": {
          "type": "object",
          "properties": {
            "sources": {
              "description": "Source files that will be uploaded on push",
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "file": {
                    "description": "Translation file which will be uploaded",
                    "type": "string",
                    "default": "<locale_name>.yml"
                  },
                  "params": {
                    "description": "Locale upload parameter",
                    "type": "object",
                    "properties": {
                      "branch": {
                        "description": "Branch name",
                        "type": "string"
                      },
                      "file_format": {
                        "$ref": "#/definitions/file_format"
                      },
                      "locale_id": {
                        "$ref": "#/definitions/locale_id"
                      },
                      "tags": {
                        "description": "List of tags separated by comma to be associated with the new keys contained in the upload",
                        "type": "string"
                      },
                      "update_translations": {
                        "description": "Indicates whether existing translations should be updated with the file content",
                        "type": "boolean",
                        "default": false
                      },
                      "update_descriptions": {
                        "description": "Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions",
                        "type": "boolean",
                        "default": false
                      },
                      "convert_emoji": {
                        "description": "Indicates whether the file contains Emoji symbols that should be converted",
                        "type": "boolean",
                        "default": false
                      },
                      "skip_upload_tags": {
                        "description": "Indicates whether the upload should not create upload tags",
                        "type": "boolean",
                        "default": false
                      },
                      "skip_unverification": {
                        "description": "Indicates whether the upload should unverify updated translations",
                        "type": "boolean",
                        "default": false
                      },
                      "file_encoding": {
                        "$ref": "#/definitions/encoding"
                      },
                      "format_options": {
                        "description": "Additional options available for specific formats. See our format guide for complete list",
                        "type": "object",
                        "properties": {
                          "column_separator": {
                            "description": "Column separator character",
                            "type": "string",
                            "default": ";"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "pull": {
          "type": "object",
          "properties": {
            "targets": {
              "description": "List of files that will be downloaded on pull",
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "file": {
                    "description": "Translation file which will be downloaded",
                    "type": "string",
                    "default": "<locale_name>.yml"
                  },
                  "project_id": {
                    "$ref": "#/definitions/project_id"
                  },
                  "params": {
                    "description": "Locale download parameter",
                    "type": "object",
                    "properties": {
                      "branch": {
                        "description": "Branch name",
                        "type": "string"
                      },
                      "file_format": {
                        "$ref": "#/definitions/file_format"
                      },
                      "tag": {
                        "description": "Limit result to keys tagged with the given tag (identified by its name)",
                        "type": "string",
                        "default": ""
                      },
                      "locale_id": {
                        "$ref": "#/definitions/locale_id"
                      },
                      "include_empty_translations": {
                        "description": "Indicates whether keys without translations should be included in the output as well",
                        "type": "boolean",
                        "default": false
                      },
                      "keep_notranslate_tags": {
                        "description": "Indicates whether [NOTRANSLATE] tags should be kept",
                        "type": "boolean",
                        "default": false
                      },
                      "convert_emoji": {
                        "description": "Indicates whether Emoji symbols should be converted to actual Emojis",
                        "type": "boolean",
                        "default": false
                      },
                      "encoding": {
                        "$ref": "#/definitions/encoding"
                      },
                      "skip_unverified_translations": {
                        "description": "Indicates whether the locale file should skip all unverified translations",
                        "type": "boolean",
                        "default": false
                      },
                      "fallback_locale_id": {
                        "description": "If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the public ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to true",
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "title": "JSON schema for PhraseApp configuration files"
}
