{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "native-schema_request_v1_0",
    "description": "json schema for a Native v1.0 request",
    "type": "object",
    "required": [
        "native"
    ],
    "properties": {
        "native": {
            "$ref": "#/definitions/native"
        }
    },
    "definitions": {
        "native": {
            "type": "object",
            "required": [
                "assets"
            ],
            "properties": {
                "ver": {
                    "type": "string"
                },
                "layout": {
                    "$ref": "#/definitions/native_layout_id"
                },
                "adunit": {
                    "$ref": "#/definitions/native_ad_unit_id"
                },
                "plcmtcnt": {
                    "$ref": "#/definitions/positive_int"
                },
                "seq": {
                    "$ref": "#/definitions/positive_int"
                },
                "assets": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/asset"
                    }
                },
                "ext": {
                    "type": "object"
                }
            }
        },
        "asset": {
            "type": "object",
            "required": [
                "id"
            ],
            "oneOf": [
                {
                    "required": [
                        "title"
                    ]
                },
                {
                    "required": [
                        "img"
                    ]
                },
                {
                    "required": [
                        "video"
                    ]
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ],
            "properties": {
                "id": {
                    "type": "integer"
                },
                "required": {
                    "$ref": "#/definitions/boolean_int"
                },
                "title": {
                    "$ref": "#/definitions/title"
                },
                "img": {
                    "$ref": "#/definitions/image"
                },
                "video": {
                    "$ref": "#/definitions/video"
                },
                "data": {
                    "$ref": "#/definitions/data"
                },
                "ext": {
                    "type": "object"
                }
            }
        },
        "title": {
            "type": "object",
            "required": [
                "len"
            ],
            "properties": {
                "len": {
                    "$ref": "#/definitions/positive_int"
                },
                "ext": {
                    "type": "object"
                }
            }
        },
        "image": {
            "type": "object",
            "properties": {
                "type": {
                    "$ref": "#/definitions/image_asset_type"
                },
                "w": {
                    "$ref": "#/definitions/positive_int"
                },
                "wmin": {
                    "$ref": "#/definitions/positive_int"
                },
                "h": {
                    "$ref": "#/definitions/positive_int"
                },
                "hmin": {
                    "$ref": "#/definitions/positive_int"
                },
                "mimes": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "ext": {
                    "type": "object"
                }
            }
        },
        "video": {
            "type": "object",
            "required": [
                "mimes",
                "minduration",
                "maxduration",
                "protocols"
            ],
            "properties": {
                "mimes": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "minduration": {
                    "$ref": "#/definitions/positive_int"
                },
                "maxduration": {
                    "$ref": "#/definitions/positive_int"
                },
                "protocols": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/video_bid_response_protocol"
                    }
                },
                "ext": {
                    "type": "object"
                }
            }
        },
        "data": {
            "type": "object",
            "required": [
                "type"
            ],
            "properties": {
                "type": {
                    "$ref": "#/definitions/data_asset_type"
                },
                "len": {
                    "$ref": "#/definitions/positive_int"
                },
                "ext": {
                    "type": "object"
                }
            }
        },
        "native_layout_id": {
            "type": "integer",
            "minimum": 1
        },
        "native_ad_unit_id": {
            "type": "integer",
            "minimum": 1
        },
        "video_bid_response_protocol": {
            "type": "integer",
            "minimum": 1,
            "maximum": 6
        },
        "data_asset_type": {
            "type": "integer",
            "minimum": 1
        },
        "image_asset_type": {
            "type": "integer",
            "minimum": 1
        },
        "boolean_int": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1
        },
        "positive_int": {
            "type": "integer",
            "minimum": 0
        }
    }
}