ThreeSixtyGiving / datagetter

Scripts to download data from http://registry.threesixtygiving.org
MIT License
1 stars 1 forks source link

New version of the standard fails valid data #42

Closed michaelwood closed 1 year ago

michaelwood commented 1 year ago

jsonschema.validate is failing valid new conditional data

Using

Cove passes the same data so it looks like we're doing something different with jsonschema validators in cove vs datagetter. This could be the need for the patched oneOf_draft4?

It would probably be better if the datagetter now used lib360dataquality rather than jsonschema.

Output

Failed validating 'required' in schema['properties']['grants']['items']:

On instance['grants'][15]:
    {'amountAppliedFor': 4947,
     'amountAwarded': 4947,
     'awardDate': '2018-06-05T00:00:00+00:00',
     'beneficiaryLocation': [{'countryCode': 'GB'}],
     'currency': 'GBP',
     'description': 'funding a new venture that supports people in older '
                    'life, bringing people together of all abilities using '
                    'walking tennis to encourage people to maintain or '
                    'improve their activity',
     'fundingOrganization': [{'id': 'GB-CHC-1057923',
                              'name': 'Devon Community Foundation'}],
     'grantProgramme': [{'code': '2018/R2', 'title': 'SfAS'}],
     'id': '360G-DevonCF-A482904',
     'recipientIndividual': {'id': '360G-DevonCF-ACC859797',
                             'name': 'Individual Recipient'},
     'title': 'Double Bounce Inclusive Tennis South West CIC',
     'toIndividualsDetails': {'grantPurpose': ['GTIP020'],
                              'primaryGrantReason': 'GTIR110',
                              'secondaryGrantReason': 'GTIR070'}}
michaelwood commented 1 year ago

Looks like the draft standard references the old version which is probably causing this https://github.com/ThreeSixtyGiving/standard/blob/336-november-feature-update/schema/360-giving-package-schema.json#L11

michaelwood commented 1 year ago

https://github.com/OpenDataServices/lib-cove/blob/main/libcove/lib/common.py#L530