MobilityData / gbfs-json-schema

JSON Schema for GBFS feeds, managed by MobilityData. The versions are organized by folders. CC BY 4.0
Apache License 2.0
23 stars 25 forks source link

Replace `dependentRequired` keywords by `dependencies` #141

Open richfab opened 1 week ago

richfab commented 1 week ago

Context

The dependentRequired keyword conditionally requires that certain properties must be present if a given property is present in an object. This conditional requirement is used for example to return an error if terms_url is defined but terms_last_updated is missing.

Problem

According to the JSON Schema doc:

Previously to Draft 2019-09, dependentRequired and dependentSchemas were one keyword called dependencies.

Since we're using a version of JSON Schema prior to Draft 2019-09, we must use the keyword dependencies.

What's Changed

This PR replaces dependentRequired keywords by dependencies in system_information.json for v2.3, v3.0 and v3.1-RC.

Before After
The JSON Schema incorrectly returned valid when terms_url was defined but terms_last_updated was missing. The JSON Schema returns an error when terms_url is defined but terms_last_updated is missing (as expected).