diff --git a/.github/ISSUE_TEMPLATE/feature-request---proposal.md b/.github/ISSUE_TEMPLATE/feature-request---proposal.md index 3c6d4b68..6c4402f2 100644 --- a/.github/ISSUE_TEMPLATE/feature-request---proposal.md +++ b/.github/ISSUE_TEMPLATE/feature-request---proposal.md @@ -19,17 +19,17 @@ A clear and concise description of what you want to happen. A breaking change would require consumers or implementors of the API to modify their code for it to continue to function (ex: renaming of a required field or the change in data type of an existing field). A non-breaking change would allow existing code to continue to function (ex: addition of an optional field or the creation of a new optional endpoint). -* [ ] Yes, breaking -* [ ] No, not breaking -* [ ] I'm not sure + * Yes, breaking + * No, not breaking + * I'm not sure ### `Provider` or `agency` For which API is this feature being requested: -* [ ] `provider` -* [ ] `agency` -* [ ] both + * `provider` + * `agency` + * both ### Describe alternatives you've considered diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5d21151b..87a44c6c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,17 +6,17 @@ Please provide a clear and concise reason for this pull request and the impact o A breaking change would require consumers or implementors of the API to modify their code for it to continue to function (ex: renaming of a required field or the change in data type of an existing field). A non-breaking change would allow existing code to continue to function (ex: addition of an optional field or the creation of a new optional endpoint). -* [ ] Yes, breaking -* [ ] No, not breaking -* [ ] I'm not sure + * Yes, breaking + * No, not breaking + * I'm not sure ### `Provider` or `agency` Which API(s) will this pull request impact: -* [ ] `provider` -* [ ] `agency` -* [ ] both + * `provider` + * `agency` + * both ### Additional context diff --git a/generate_schema/Pipfile b/generate_schema/Pipfile deleted file mode 100644 index fd432d52..00000000 --- a/generate_schema/Pipfile +++ /dev/null @@ -1,13 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] - -[dev-packages] -jsonschema = "==3.0.0b3" -requests = "*" - -[requires] -python_version = "3.6" diff --git a/schema/README.md b/schema/README.md new file mode 100644 index 00000000..6e31a39f --- /dev/null +++ b/schema/README.md @@ -0,0 +1,5 @@ +# MDS Schema Definition + +The following directory contains the code to generate the offical JSON schemas for the Mobility Data Specification. However, the official schemas live inside the `provider`, `agency` or appropriate folder. + +To generate the schemas, run `python generate_schema.py` from inside this directory. To edit the JSON schemas that are generated, edit the approrpriate file inside the the `templates` directory then run the appropriate command. \ No newline at end of file diff --git a/generate_schema/generate_schema.py b/schema/generate_schema.py similarity index 94% rename from generate_schema/generate_schema.py rename to schema/generate_schema.py index b8de5b44..36f18e9c 100644 --- a/generate_schema/generate_schema.py +++ b/schema/generate_schema.py @@ -109,7 +109,7 @@ def get_json_file(path): if __name__ == '__main__': # Load common data - common = get_json_file('common.json') + common = get_json_file('./templates/common.json') point = get_point_schema() multipolygon = get_multipolygon_schema() # Craft the MDS specific types @@ -136,7 +136,7 @@ def get_json_file(path): ######### # Create the standalone trips JSON schema by including the needed definitions - trips = get_json_file('provider/trips.json') + trips = get_json_file('./templates/provider/trips.json') trips["definitions"] = { POINT: point, MDS_FEATURE_POINT: mds_feature_point, @@ -161,7 +161,7 @@ def get_json_file(path): ################## # Create the standalone status_changes JSON schema by including the needed definitions - status_changes = get_json_file('provider/status_changes.json') + status_changes = get_json_file('./templates/provider/status_changes.json') status_changes["definitions"] = { POINT: point, MDS_FEATURE_POINT: mds_feature_point, @@ -184,7 +184,7 @@ def get_json_file(path): ############### # Create the standalone GET vehicle JSON schema by including the needed definitions - get_vehicle = get_json_file('agency/get_vehicle.json') + get_vehicle = get_json_file('./templates/agency/get_vehicle.json') get_vehicle["definitions"] = { "propulsion_type": common["definitions"]["propulsion_type"], "vehicle_type": common["definitions"]["vehicle_type"], @@ -204,7 +204,7 @@ def get_json_file(path): ################ # Create the standalone POST vehicle JSON schema by including the needed definitions - post_vehicle = get_json_file('agency/post_vehicle.json') + post_vehicle = get_json_file('./templates/agency/post_vehicle.json') post_vehicle["definitions"] = { "propulsion_type": common["definitions"]["propulsion_type"], "vehicle_type": common["definitions"]["vehicle_type"], @@ -221,7 +221,7 @@ def get_json_file(path): ###################### # Create the standalone POST vehicle event JSON schema by including the needed definitions - post_vehicle_event = get_json_file('agency/post_vehicle_event.json') + post_vehicle_event = get_json_file('./templates/agency/post_vehicle_event.json') post_vehicle_event["definitions"] = { "vehicle_event": common["definitions"]["vehicle_event"], "telemetry": common["definitions"]["telemetry"], @@ -238,7 +238,7 @@ def get_json_file(path): ########################## # Create the standalone POST vehicle telemetry JSON schema by including the needed definitions - post_vehicle_telemetry = get_json_file('agency/post_vehicle_telemetry.json') + post_vehicle_telemetry = get_json_file('./templates/agency/post_vehicle_telemetry.json') post_vehicle_telemetry["definitions"] = { "telemetry": common["definitions"]["telemetry"], } @@ -253,7 +253,7 @@ def get_json_file(path): #################### # Create the standalone GET service area JSON schema by including the needed definitions - get_service_area = get_json_file('agency/get_service_area.json') + get_service_area = get_json_file('./templates/agency/get_service_area.json') get_service_area["definitions"] = { MULTIPOLYGON: multipolygon, "area_type": common["definitions"]["area_type"], diff --git a/generate_schema/requirements.txt b/schema/requirements.txt similarity index 100% rename from generate_schema/requirements.txt rename to schema/requirements.txt diff --git a/generate_schema/agency/get_service_area.json b/schema/templates/agency/get_service_area.json similarity index 100% rename from generate_schema/agency/get_service_area.json rename to schema/templates/agency/get_service_area.json diff --git a/generate_schema/agency/get_vehicle.json b/schema/templates/agency/get_vehicle.json similarity index 100% rename from generate_schema/agency/get_vehicle.json rename to schema/templates/agency/get_vehicle.json diff --git a/generate_schema/agency/post_vehicle.json b/schema/templates/agency/post_vehicle.json similarity index 100% rename from generate_schema/agency/post_vehicle.json rename to schema/templates/agency/post_vehicle.json diff --git a/generate_schema/agency/post_vehicle_event.json b/schema/templates/agency/post_vehicle_event.json similarity index 100% rename from generate_schema/agency/post_vehicle_event.json rename to schema/templates/agency/post_vehicle_event.json diff --git a/generate_schema/agency/post_vehicle_telemetry.json b/schema/templates/agency/post_vehicle_telemetry.json similarity index 100% rename from generate_schema/agency/post_vehicle_telemetry.json rename to schema/templates/agency/post_vehicle_telemetry.json diff --git a/generate_schema/common.json b/schema/templates/common.json similarity index 100% rename from generate_schema/common.json rename to schema/templates/common.json diff --git a/generate_schema/provider/status_changes.json b/schema/templates/provider/status_changes.json similarity index 100% rename from generate_schema/provider/status_changes.json rename to schema/templates/provider/status_changes.json diff --git a/generate_schema/provider/trips.json b/schema/templates/provider/trips.json similarity index 100% rename from generate_schema/provider/trips.json rename to schema/templates/provider/trips.json