{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "title": {
            "type": "string"
        },
        "contributors": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "sources": {
            "type": "array",
            "minLength": 1,
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "format": "uri"
                    },
                    "web": {
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ]
            }
        },
        "resources": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string"
                    },
                    "publication_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "(\\d{2}-(\\d{2})-(\\d{4}))"
                    },
                    "schema": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "fields": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "name": {
                                            "type": "string"
                                        },
                                        "translates_to": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "maps_to": {
                                            "type": [
                                                "null",
                                                "string",
                                                "array"
                                            ],
                                            "enum": [
                                                null,
                                                "funding_period_number",
                                                "funding_period",
                                                "cci_program_code",
                                                "cci_program_title",
                                                "project_id",
                                                "project_name",
                                                "beneficiary_id",
                                                "beneficiary_name",
                                                "beneficiary_postal_code",
                                                "beneficiary_address",
                                                "beneficiary_country_code",
                                                "beneficiary_country",
                                                "beneficiary_nuts_code",
                                                "beneficiary_nuts_region",
                                                "beneficiary_city",
                                                "fund_acronym",
                                                "fund_name",
                                                "theme_code",
                                                "theme_name",
                                                "priority_number",
                                                "priority_label",
                                                "starting_date",
                                                "completion_date",
                                                "approval_date",
                                                "first_payment_date",
                                                "final_payment_date",
                                                "total_amount",
                                                "total_amount_applied",
                                                "total_amount_eligible",
                                                "member_state_amount",
                                                "third_party_amount",
                                                "eu_cofinancing_amount",
                                                "european_investment_bank_amount",
                                                "beneficiary_url",
                                                "project_description"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "name"
                                    ]
                                }
                            }
                        },
                        "required": [
                            "fields"
                        ]
                    },
                    "url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "path": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "title",
                    "publication_date",
                    "schema"
                ]
            }
        },
        "description": {
            "type": [
                "string",
                "null"
            ]
        },
        "scraper_required": {
            "type": "boolean"
        },
        "language": {
            "type": "string",
            "pattern": "(\\w{2})"
        },
        "extension": {
            "enum": [
                ".xls",
                ".xlsx",
                ".csv",
                ".pdf"
            ]
        }
    },
    "required": [
        "title",
        "contributors",
        "sources",
        "resources",
        "scraper_required",
        "language",
        "description"
    ]
}