openactive / data-model-validator

The OpenActive data model validator library
MIT License
1 stars 1 forks source link

Validator does not understand empty RPDE pages #443

Closed lukehesluke closed 8 months ago

lukehesluke commented 8 months ago

Spawned from https://github.com/openactive/rpde-validator/issues/25

As mentioned in that issue, if you put an empty RPDE page into the Data Model Validator, it will fail it and provide misleading errors like Please add an @type property to this JSON object.

Still happening?

To confirm that this is still the case, using https://validator.openactive.io/

This passes (model) validation

{
  "next": "https://acme-feed.com/feeds/scheduled-sessions?afterChangeNumber=1234",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "items": [
    {
      "state": "deleted",
      "kind": "ScheduledSession",
      "id": "12345",
      "modified": 1235
    }
  ]
}

This fails (model) validation

{
  "next": "https://acme-feed.com/feeds/scheduled-sessions?afterChangeNumber=1234",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "items": []
}

Impact

I'm not sure what prompted this issue in the first place, but it does seem that it could hamper a data publisher's ability to run automated validation on their feeds as part of CI, which should otherwise be encouraged