Skip to content

Commit

Permalink
Merge pull request #5 from transitland/remove-single-url
Browse files Browse the repository at this point in the history
remove support for `feed.url`
  • Loading branch information
drewda authored Mar 10, 2020
2 parents 1f0b658 + 21bd658 commit 95fff81
Show file tree
Hide file tree
Showing 3 changed files with 300 additions and 1 deletion.
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Changelog

## 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.

Here's an old example from Transitland Atlas:

```json
{
"$schema": "https://dmfr.transit.land/json-schema/dmfr.schema-v0.1.2.json",
"feeds": [
{
"spec": "gtfs",
"id": "f-tulare~time",
"url": "http://www.tularecog.org/googletransit/TIME/google_transit.zip"
},
{
"spec": "gtfs",
"id": "f-tulare~tcat",
"url": "http://www.tularecog.org/googletransit/TCAT/google_transit.zip"
},
{
"spec": "gtfs",
"id": "f-tulare~dart",
"url": "http://www.tularecog.org/googletransit/DART/google_transit.zip"
}
],
"license_spdx_identifier": "CDLA-Permissive-1.0"
}
```

And here's the same example updated for DMFR v0.2.0:

```json
{
"$schema": "https://dmfr.transit.land/json-schema/dmfr.schema-v0.2.0.json",
"feeds": [
{
"spec": "gtfs",
"id": "f-tulare~time",
"urls": {
"static_current": "http://www.tularecog.org/googletransit/TIME/google_transit.zip"
}
},
{
"spec": "gtfs",
"id": "f-tulare~tcat",
"urls": {
"static_current": "http://www.tularecog.org/googletransit/TCAT/google_transit.zip"
}
},
{
"spec": "gtfs",
"id": "f-tulare~dart",
"urls": {
"static_current": "http://www.tularecog.org/googletransit/DART/google_transit.zip"
}
}
],
"license_spdx_identifier": "CDLA-Permissive-1.0"
}
```
236 changes: 236 additions & 0 deletions json-schema/dmfr.schema-v0.2.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
{
"$id": "https://dmfr.transit.land/json-schema/dmfr.schema-v0.2.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": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"realtime_trip_updates": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"realtime_alerts": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_system_information": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_station_information": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_station_status": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_free_bike_status": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_system_hours": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_system_calendar": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_system_regions": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_system_pricing_plans": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"gbfs_system_alerts": {
"type": "string",
"description": "TODO",
"pattern": "^(http|https|ftp):\/\/[a-zA-Z0-9.~#{}/=?_/-]+$"
},
"mds_provider": {
"type": "string",
"description": "TODO",
"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 95fff81

Please sign in to comment.