Skip to content

Internal Validator Error when activity contains null fields #416

@lukehesluke

Description

@lukehesluke

Reproduce by putting this JSON into https://validator.openactive.io/:

{
  "@context": "https://openactive.io/",
  "url": "https://example.com/id",
  "id": "https://example.com/url",
  "@type": "SessionSeries",
  "activity": [
    {
      "@type": "Concept",
      "id": null,
      "inScheme": "https://openactive.io/activity-list",
      "prefLabel": null
    }
  ],
  "organizer": {
    "id": "https://example.com/org-id",
    "@type": "Organization",
    "name": "Lorem Ipsum",
    "url": "https://example.com/org-url"
  },
  "duration": "PT1H",
  "name": "Dolor sit amet",
  "location": {
    "@type": "Place",
    "url": "https://example.com/loc-url",
    "name": "consectetur adipiscing elit",
    "id": "https://example.com/loc-id",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "GB",
      "streetAddress": "Duis vestibulum",
      "addressLocality": "velit nulla",
      "addressRegion": "eu ornare",
      "postalCode": "AB1 2CD"
    },
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": 0,
      "longitude": 0
    }
  },
  "eventSchedule": [
    {
      "@type": "PartialSchedule",
      "startDate": "2001-01-01",
      "endDate": "2001-01-20"
    }
  ],
  "offers": [
    {
      "@type": "Offer",
      "price": 0,
      "priceCurrency": "GBP"
    }
  ]
}

You'll see this error:

Screenshot 2022-10-19 at 16 54 26

Internal validator error: Cannot read property 'toLowerCase' of null

This error hides the actual issue, which is that .activity[].id and .prefLabel are required

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions