This directory contains the templates and code that generate the official JSON schemas for the Mobility Data Specification. However, the official schema documents live inside the provider
, agency
or appropriate folder.
At a command prompt within this schema
directory run:
python generate_schemas.py [--agency] [--geography] [--policy] [--provider]
The optional flags --agency
, --geography
, --policy
, and --provider
can be used to specify which
set of schemas to generate. The default is to generate all schemas.
-
Edit the appropriate file(s) inside the the
templates/
directory. -
Run the command to regenerate the schema(s).
-
Create a new template in the appropriate folder inside
templates/
. See the existing templates for ideas. Remember to reference shared definitions fromtemplates/common.json
. -
Edit the appropriate
.py
file to add a function that creates the new schema as adict
. See the existing functions for ideas. Thecommon
module defines some shared functionality. -
Add your schema name and generator function to the collection in the
schema_generators()
function at the top of each.py
file. -
Run the command to regenerate the schema(s).