Skip to content

Commit

Permalink
generate Provider schemas into the root
Browse files Browse the repository at this point in the history
Existing endpoints are being augmented with Docked information
and new endpoints will co-exist.
  • Loading branch information
thekaveman committed Jun 29, 2020
1 parent f59add2 commit 1b9288d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ ttl | Yes | Integer representing the number of millisecond
[decimal-degrees]: https://en.wikipedia.org/wiki/Decimal_degrees
[dgps]: https://en.wikipedia.org/wiki/Differential_GPS
[events]: #events
[events-schema]: dockless/events.json
[events-schema]: events.json
[event-times]: #event-times
[gbfs]: https://github.com/NABSA/gbfs
[general-information]: /general-information.md
Expand All @@ -399,16 +399,16 @@ ttl | Yes | Integer representing the number of millisecond
[propulsion-types]: /general-information.md#propulsion-types
[responses]: /general-information.md#responses
[status]: #status-changes
[status-schema]: dockless/status_changes.json
[status-schema]: status_changes.json
[st-intersects]: https://postgis.net/docs/ST_Intersects.html
[toc]: #table-of-contents
[trips]: #trips
[trips-schema]: dockless/trips.json
[trips-schema]: trips.json
[ts]: /general-information.md#timestamps
[vehicles]: #vehicles
[vehicle-types]: /general-information.md#vehicle-types
[vehicle-states]: /general-information.md#vehicle-states
[vehicle-events]: /general-information.md#vehicle-state-events
[vehicles-schema]: dockless/vehicles.json
[vehicles-schema]: vehicles.json
[versioning]: /general-information.md#versioning
[wgs84]: https://en.wikipedia.org/wiki/World_Geodetic_System
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions schema/generate_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,28 +465,29 @@ def write_provider_schemas(common_definitions):
Create each of the Provider endpoint schema files in the appropriate directory.
"""
print("\nStarting to generate Provider JSON Schemas...\n")
directory = "../provider"

# /trips
trips = provider_trips_schema(common_definitions)
with open("../provider/dockless/trips.json", "w") as schemafile:
with open(f"{directory}/trips.json", "w") as schemafile:
schemafile.write(json.dumps(trips, indent=2))
print("Wrote trips.json")

# /status_changes
status_changes = provider_status_changes_schema(common_definitions)
with open("../provider/dockless/status_changes.json", "w") as schemafile:
with open(f"{directory}/status_changes.json", "w") as schemafile:
schemafile.write(json.dumps(status_changes, indent=2))
print("Wrote status_changes.json")

# /events
events = provider_events_schema(common_definitions)
with open("../provider/dockless/events.json", "w") as schemafile:
with open(f"{directory}/events.json", "w") as schemafile:
schemafile.write(json.dumps(events, indent=2))
print("Wrote events.json")

# /vehicles
vehicles = provider_vehicles_schema(common_definitions)
with open("../provider/dockless/vehicles.json", "w") as schemafile:
with open(f"{directory}/vehicles.json", "w") as schemafile:
schemafile.write(json.dumps(vehicles, indent=2))
print("Wrote vehicles.json")

Expand Down

0 comments on commit 1b9288d

Please sign in to comment.