{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Some app",
    "type": "object",
    "definitions": {
        "app": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "Some app",
            "type": "object",
            "definitions": {
                "domains": {
                    "items": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "description": "Some app",
                        "type": "object",
                        "definitions": {
                            "name": {
                                "format": "hostname",
                                "type": "string"
                            }
                        },
                        "properties": {
                            "name": {
                                "format": "hostname",
                                "type": "string"
                            }
                        },
                        "required": [
                            "name"
                        ]
                    },
                    "type": "array"
                },
                "name": {
                    "pattern": "^[a-z][a-z0-9-]{3,30}$",
                    "type": "string"
                }
            },
            "properties": {
                "domains": {
                    "items": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "description": "Some app",
                        "type": "object",
                        "definitions": {
                            "name": {
                                "format": "hostname",
                                "type": "string"
                            }
                        },
                        "properties": {
                            "name": {
                                "format": "hostname",
                                "type": "string"
                            }
                        },
                        "required": [
                            "name"
                        ]
                    },
                    "type": "array"
                },
                "name": {
                    "pattern": "^[a-z][a-z0-9-]{3,30}$",
                    "type": "string"
                }
            },
            "required": [
                "name"
            ]
        },
        "domain": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "Some app",
            "type": "object",
            "definitions": {
                "name": {
                    "format": "hostname",
                    "type": "string"
                }
            },
            "properties": {
                "name": {
                    "format": "hostname",
                    "type": "string"
                }
            },
            "required": [
                "name"
            ]
        }
    },
    "properties": {
        "app": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "Some app",
            "type": "object",
            "definitions": {
                "domains": {
                    "items": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "description": "Some app",
                        "type": "object",
                        "definitions": {
                            "name": {
                                "format": "hostname",
                                "type": "string"
                            }
                        },
                        "properties": {
                            "name": {
                                "format": "hostname",
                                "type": "string"
                            }
                        },
                        "required": [
                            "name"
                        ]
                    },
                    "type": "array"
                },
                "name": {
                    "pattern": "^[a-z][a-z0-9-]{3,30}$",
                    "type": "string"
                }
            },
            "properties": {
                "domains": {
                    "items": {
                        "$schema": "http://json-schema.org/draft-04/schema#",
                        "description": "Some app",
                        "type": "object",
                        "definitions": {
                            "name": {
                                "format": "hostname",
                                "type": "string"
                            }
                        },
                        "properties": {
                            "name": {
                                "format": "hostname",
                                "type": "string"
                            }
                        },
                        "required": [
                            "name"
                        ]
                    },
                    "type": "array"
                },
                "name": {
                    "pattern": "^[a-z][a-z0-9-]{3,30}$",
                    "type": "string"
                }
            },
            "required": [
                "name"
            ]
        },
        "domain": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "Some app",
            "type": "object",
            "definitions": {
                "name": {
                    "format": "hostname",
                    "type": "string"
                }
            },
            "properties": {
                "name": {
                    "format": "hostname",
                    "type": "string"
                }
            },
            "required": [
                "name"
            ]
        }
    },
    "links": [
        {
            "description": "List apps.",
            "href": "/apps",
            "method": "GET",
            "rel": "instances",
            "targetSchema": {
                "items": {
                    "$schema": "http://json-schema.org/draft-04/schema#",
                    "description": "Some app",
                    "type": "object",
                    "definitions": {
                        "domains": {
                            "items": {
                                "$schema": "http://json-schema.org/draft-04/schema#",
                                "description": "Some app",
                                "type": "object",
                                "definitions": {
                                    "name": {
                                        "format": "hostname",
                                        "type": "string"
                                    }
                                },
                                "properties": {
                                    "name": {
                                        "format": "hostname",
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "type": "array"
                        },
                        "name": {
                            "pattern": "^[a-z][a-z0-9-]{3,30}$",
                            "type": "string"
                        }
                    },
                    "properties": {
                        "domains": {
                            "items": {
                                "$schema": "http://json-schema.org/draft-04/schema#",
                                "description": "Some app",
                                "type": "object",
                                "definitions": {
                                    "name": {
                                        "format": "hostname",
                                        "type": "string"
                                    }
                                },
                                "properties": {
                                    "name": {
                                        "format": "hostname",
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "type": "array"
                        },
                        "name": {
                            "pattern": "^[a-z][a-z0-9-]{3,30}$",
                            "type": "string"
                        }
                    },
                    "required": [
                        "name"
                    ]
                },
                "type": "array"
            },
            "title": "List"
        },
        {
            "description": "Create a new app.",
            "href": "/apps",
            "method": "POST",
            "rel": "create",
            "schema": {
                "properties": {
                    "name": {
                        "format": "hostname",
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ],
                "type": "object"
            },
            "title": "Create",
            "targetSchema": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "description": "Some app",
                "type": "object",
                "definitions": {
                    "domains": {
                        "items": {
                            "$schema": "http://json-schema.org/draft-04/schema#",
                            "description": "Some app",
                            "type": "object",
                            "definitions": {
                                "name": {
                                    "format": "hostname",
                                    "type": "string"
                                }
                            },
                            "properties": {
                                "name": {
                                    "format": "hostname",
                                    "type": "string"
                                }
                            },
                            "required": [
                                "name"
                            ]
                        },
                        "type": "array"
                    },
                    "name": {
                        "pattern": "^[a-z][a-z0-9-]{3,30}$",
                        "type": "string"
                    }
                },
                "properties": {
                    "domains": {
                        "items": {
                            "$schema": "http://json-schema.org/draft-04/schema#",
                            "description": "Some app",
                            "type": "object",
                            "definitions": {
                                "name": {
                                    "format": "hostname",
                                    "type": "string"
                                }
                            },
                            "properties": {
                                "name": {
                                    "format": "hostname",
                                    "type": "string"
                                }
                            },
                            "required": [
                                "name"
                            ]
                        },
                        "type": "array"
                    },
                    "name": {
                        "pattern": "^[a-z][a-z0-9-]{3,30}$",
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ]
            }
        }
    ]
}