<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def schema(self):
 """ The generated budget data package schema for this resource. If the resource has any fields that do not conform to the provided specification this will raise a NotABudgetDataPackageException. """


        if self.headers is None:
            raise exceptions.NoResourceLoadedException(
                'Resource must be loaded to find schema')
        try:
            fields = self.specification.get('fields', {})
            parsed = {
                'primaryKey': 'id',
                'fields': [{
                        'name': header,
                        'type': fields[header]['type'],
                        'description': fields[header]['description']
                        } for header in self.headers]
                }
        except KeyError:
            raise exceptions.NotABudgetDataPackageException(
                'Includes other fields than the Budget Data Package fields')
        return parsed