Skip to content

Commit

Permalink
Merge pull request #6 from transitland/gbfs-auto-discovery-url
Browse files Browse the repository at this point in the history
GBFS will now only take a `gbfs_auto_discovery` URL
  • Loading branch information
drewda authored May 13, 2020
2 parents 18ab67f + d08ab48 commit 63f3351
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.3.0

When `spec=gbfs`, only one type of URL is now needed or allowed: `gbfs_auto_discovery`.

We made this decision because all of the GBFS feeds listed in [`systems.csv`](https://github.com/NABSA/gbfs/blob/v2.0/systems.csv) supply an auto-discovery URL. Also [GBFS v2.0](https://github.com/NABSA/gbfs/releases/tag/v2.0) requires the auto-discovery JSON file.

## v0.2.0

**Breaking change**: We've removed support to specify a static GTFS feed URL using `feed.url`. Now the one option is to specify this using `feed.urls.static_current`. This change will slightly simplifying tooling that validates or consumes DMFR.
Expand Down
196 changes: 196 additions & 0 deletions json-schema/dmfr.schema-v0.3.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
{
"$id": "https://dmfr.transit.land/json-schema/dmfr.schema-v0.3.0.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Distributed Mobility Feed Registry",
"type": "object",
"properties": {
"feeds": {
"type": "array",
"items": {
"$ref": "#/definitions/feed"
}
},
"license_spdx_identifier": {
"type": "string"
}
},
"definitions": {
"feed": {
"type": "object",
"required": ["id", "spec", "urls"],
"properties": {
"id": {
"type": "string",
"description": "Identifier for this feed, internal to this DMFR instance. (Optionally can be a Onestop ID.)"
},
"spec": {
"type": "string",
"enum": ["gtfs", "gtfs-rt", "gbfs", "mds"],
"description": "Type of data contained in this feed: GTFS, GTFS-RT, GBFS, or MDS."
},
"urls": {
"type": "object",
"properties": {
"static_current": {
"type": "string",
"description": "URL (in Transitland Extended URL format) for the static feed that represents today's service. (Has the same meaning as url.)",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"static_historic": {
"type": "array",
"items": {
"type": "string",
"description": "URLs (in Transitland Extended URL format) for static feeds that represent past service that is no longer in effect.",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
}
},
"static_planned": {
"type": "array",
"items": {
"type": "string",
"description": "URLs (in Transitland Extended URL format) for static feeds that represent service planned for upcoming dates. Typically used to represent calendar/service changes that will take effect few weeks or months in the future.",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
}
},
"static_hypothetical": {
"type": "array",
"items": {
"type": "string",
"description": "URLs (in Transitland Extended URL format) for static feeds that represent potential service or network changes. Typically used to represent scenarios that may (or may not) take effect months or years in the future.",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
}
},
"realtime_vehicle_positions": {
"type": "string",
"description": "URL for GTFS Realtime VehiclePosition messages.",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"realtime_trip_updates": {
"type": "string",
"description": "URL for GTFS Realtime TripUpdate messages.",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"realtime_alerts": {
"type": "string",
"description": "URL for GTFS Realtime Alert messages.",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_auto_discovery": {
"type": "string",
"description": "Auto-discovery file in JSON format that links to all of the other GBFS files published by the system.",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"mds_provider": {
"type": "string",
"description": "MDS provider API endpoints are intended to be implemented by mobility providers and consumed by regulatory agencies.",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
}
}
},
"associated_feeds": {
"type": "array",
"description": "List of associated feeds, using IDs internal to this DMFR instance. For example to one or more GTFS feeds associated with an GTFS-RT feed.",
"items": {
"type": "string",
"description": "Identifier for an associated feed, using ID internal to this DMFR."
}
},
"feed_namespace_id": {
"type": "string",
"description": "Feeds that share the same feed_namespace_id value can be combined without needing to rewrite entity IDs. (Optionally can be an operator Onestop ID.)"
},
"other_ids": {
"type": "object",
"description": "Identifiers for this feed used by other DMFR instances. Key is the DMFR instance or feed registry platform; value is the feed ID."
},
"languages": {
"type": "array",
"description": "Language(s) included in this feed.",
"items": {
"$ref": "#/definitions/language"
}
},
"license": {
"$ref": "#/definitions/license_description"
},
"authorization": {
"$ref": "#/definitions/authorization"
}
}
},
"language": {
"type": "string",
"description": "A language specified using an IETF language tag."
},
"license_description": {
"type": "object",
"oneOf": [{
"required": ["spdx_identifier"]
}, {
"required": ["url"]
}],
"properties": {
"spdx_identifier": {
"type": "string",
"description": "SPDX identifier for a common license. See https://spdx.org/licenses/"
},
"url": {
"type": "string",
"description": "URL for a custom license."
},
"use_without_attribution": {
"type": "string",
"enum": ["yes", "no", "unknown"],
"description": "Are feed consumers allowed to use the feed contents without including attribution text in their app or map?"
},
"create_derived_product": {
"type": "string",
"enum": ["yes", "no", "unknown"],
"description": "Are feed consumers allowed to create and share derived products from the feed?"
},
"redistribution_allowed": {
"type": "string",
"enum": ["yes", "no", "unknown"],
"description": "Are feed consumers allowed to redistribute the feed in its entirety?"
},
"commercial_use_allowed": {
"type": "string",
"enum": ["yes", "no", "unknown"],
"description": "Are feed consumers allowed to use the feed for commercial purposes?"
},
"share_alike_optional": {
"type": "string",
"enum": ["yes", "no", "unknown"],
"description": "Are feed consumers allowed to keep their modifications of this feed private?"
},
"attribution_text": {
"type": "string",
"description": "Feed consumers must include this particular text when using this feed."
},
"attribution_instructions": {
"type": "string",
"description": "Feed consumers must follow these instructions for how to provide attribution."
}
}
},
"authorization": {
"type": "object",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"enum": ["header", "basic_auth", "query_param", "path_segment"],
"description": "Authorization approach: HTTP header, basic authentication, query parameter, or path segment in a Transitland Extended URL."
},
"param_name": {
"type": "string",
"description": "When type=query_param, this specifies the name of the query parameter."
},
"info_url": {
"type": "string",
"description": "Website to visit to sign up for an account."
}
}
}
}
}
2 changes: 1 addition & 1 deletion json-schema/dmfr.schema.json

0 comments on commit 63f3351

Please sign in to comment.