{
  "title": "JSON schema for Web Application manifest files",
  "$schema": "http://json-schema.org/draft-04/schema#",

  "type": "object",

  "properties": {
    "name": {
      "description": "The name of the web application.",
      "type": "string"
    },
    "short_name": {
      "description": "A string that represents a short version of the name of the web application.",
      "type": "string"
    },
    "scope": {
      "description": "A string that represents the navigation scope of this web application's application context.",
      "type": "string",
      "format": "uri"
    },
    "icons": {
      "description": "The icons member is an array of icon objects that can serve as iconic representations of the web application in various contexts.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/icon"
      }
    },
    "display": {
      "description": "The item represents the developer's preferred display mode for the web application.",
      "enum": [ "fullscreen", "standalone", "minimal-ui", "browser" ]
    },
    "orientation": {
      "description": "The orientation member is a string that serves as the default orientation for all  top-level browsing contexts of the web application.",
      "enum": [ "any", "natural", "landscape", "portrait", "portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary" ]
    },
    "start_url": {
      "description": "Represents the URL that the developer would prefer the user agent load when the user launches the web application.",
      "type": "string",
      "format": "uri"
    },
    "theme_color": {
      "description": "The default theme color for the browsing contexts of an application",
      "type": "string"
    },
    "dir": {
      "description": "Specifies the base direction for the directionality-capable members of the manifest (the directionality-capable members are: description, name, short_name).",
      "enum": [ "ltr", "rtl", "auto" ]
    },
    "lang": {
      "description": "A language tag (string) that specifies the primary language for the values of the manifest's directionality-capable members.",
      "type": "string"
    },
    "description": {
      "description": "A string that allows the developer to describe the purpose of the web application.",
      "type": "string"
    },
    "background_color": {
      "description": "A string describing the expected background color of the web application.",
      "type": "string"
    },
    "related_applications": {
      "description": "The related_applications member is an array of applications objects that lists related applications and serves as an indication of such a relationship between web application and related applications.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/application"
      }
    },
    "prefer_related_applications": {
      "description": "A boolean value that is used as a hint for the user agent to say that related applications should be preferred over the web application.",
      "type": "boolean"
    },
    "categories": {
      "description": "An array of strings defining the expected application categories to which the web application belongs. While any string is considered valid, W3C maintains a list of known category strings at https://github.com/w3c/manifest/wiki/Categories",
      "type": "array"
    },
    "screenshots": {
      "description": "An array of images representing the application in common usage scenarios.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/icon"
      }
    },
    "iarc_rating_id": {
      "description": "The International Age Rating Coalition (IARC) certification code of the web application. It is intended to be used to determine which ages the web application is appropriate for.",
      "type": "string"
    },
    "shortcuts": {
      "description": "An array of shortcut items that provide access to key tasks within a web application.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/shortcutItem"
      }
    }
  },

  "definitions": {
    "icon": {
      "type": "object",
      "properties": {
        "sizes": {
          "description": "The sizes member is a string consisting of an unordered set of unique space-separated tokens which are ASCII case-insensitive that represents the dimensions of an icon for visual media.",
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[0-9 x]+$"
            },
            {
              "enum": [ "any" ]
            }
          ]
        },
        "src": {
          "description": "The src member of an icon is a URL from which a user agent can fetch the icon's data.",
          "type": "string",
          "format": "uri"
        },
        "type": {
          "description": "The type member of an icon is a hint as to the media type of the icon.",
          "type": "string",
          "pattern": "^[\\sa-z0-9\\-+;\\.=\\/]+$"
        },
        "purpose": {
          "description": "An unordered set of unique space-separated tokens that are ASCII case-insensitive. The allowed values are the icon purposes.",
          "type": "string",
          "enum": [ "badge", "maskable", "any" ]
        },
        "platform": {
          "description": "The platform to which a containing object applies.",
          "type": "string"
        }
      }
    },
    "application": {
      "type": "object",
      "properties": {
        "platform": {
          "description": "The description member of an application is a string that represents the platform on which the application can be found.",
          "type": "string"
        },
        "url": {
          "description": "The url member of an application represents the URL at which the application can be found.",
          "type": "string",
          "format": "uri"
        },
        "id": {
          "description": "The id member of an application is a string that represents the id which is used to represent the application on the platform.",
          "type": "string"
        }
      }
    },
    "shortcutItem": {
      "type": "object",
      "properties": {
        "name": {
          "description": "The name of the shortcut as it is usually displayed to the user in a context menu.",
          "type": "string"
        },
        "short_name": {
          "description": "A short version of the name of the shortcut. It is intended to be used where there is insufficient space to display the full name of the shortcut.",
          "type": "string"
        },
        "description": {
          "description": "Describes the purpose of the shortcut. User agents MAY expose this information to assistive technology",
          "type": "string"
        },
        "url": {
          "description": "The URL within the application's scope that opens when the associated shortcut is activated.",
          "type": "string",
          "format": "uri"
        },
        "icons": {
          "description": "The images to serve as iconic representations of the shortcut in various contexts.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/icon"
          }
        }
      }
    }
  }
}
