-
Notifications
You must be signed in to change notification settings - Fork 0
Add geospatial extent to model ouput schema #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 66-clone-of-schema
Are you sure you want to change the base?
Changes from all commits
a690bd6
faf68e4
e6b7b9c
aad7489
ed987e8
8018aab
5ef8d15
3247f46
7e273f0
0c309fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,13 @@ on: | |
| workflow_dispatch: | ||
|
|
||
| env: | ||
| SCHEMA_DIR: au.org.access-nri/model/output/file-metadata/2-0-0 | ||
| TEST_DIR: tests/2-0-0 | ||
| SCHEMA_DIRS: | | ||
| au.org.access-nri/model/output/file-metadata/2-0-0 | ||
| au.org.access-nri/model/output/file-metadata/2-1-0 | ||
| # TEST_DIRS need to have matching SCHEMA_DIRS in the same order | ||
| TEST_DIRS: | | ||
| tests/2-0-0 | ||
| tests/2-1-0 | ||
|
|
||
| jobs: | ||
| schema-tests: | ||
|
|
@@ -18,16 +23,31 @@ jobs: | |
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install the Sourcemeta JSON Schema CLI | ||
| uses: sourcemeta/jsonschema@v11.8.3 | ||
| uses: sourcemeta/jsonschema@v14.14.2 | ||
|
|
||
| - name: Check schemas against their metaschemas | ||
| run: jsonschema metaschema --verbose $SCHEMA_DIR | ||
| run: jsonschema metaschema --verbose $SCHEMA_DIRS | ||
|
|
||
| - name: Check schemas are formatted | ||
| run: jsonschema fmt --check --verbose $SCHEMA_DIR | ||
| run: jsonschema fmt --check --verbose $SCHEMA_DIRS | ||
|
|
||
| - name: Lint schemas | ||
| run: jsonschema lint --verbose --exclude enum_with_type $SCHEMA_DIR | ||
| run: | | ||
| jsonschema lint --verbose \ | ||
| --exclude enum_with_type \ | ||
| --exclude description_trailing_period \ | ||
| --exclude top_level_examples \ | ||
| $SCHEMA_DIRS | ||
|
|
||
| - name: Run test suite | ||
| run: jsonschema test --verbose $TEST_DIR --resolve $SCHEMA_DIR | ||
| run: | | ||
| # Need to iterate through each pair of DIRS since there will be name | ||
| # collisions with different versions of the same schema | ||
|
Comment on lines
+44
to
+45
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need to specify |
||
| # Turn the strings into arrays of strings first | ||
| test_arr=($TEST_DIRS) | ||
| schema_arr=($SCHEMA_DIRS) | ||
| for i in "${!test_arr[@]}"; do | ||
| test_dir=${test_arr[i]} | ||
| schema_dir=${schema_arr[i]} | ||
| jsonschema test --verbose $test_dir --resolve $schema_dir | ||
| done | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "global/geospatial_lat_max.json", | ||
| "title": "geospatial_lat_max", | ||
| "description": "Specifies the northernmost latitude covered by the dataset. Units should be \"degrees North\" and values should be a number equal to or between -90 and 90.", | ||
| "examples": [ 90, 12.98 ], | ||
| "type": "number", | ||
| "maximum": 90, | ||
| "minimum": -90 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know it's difficult to say a-priori what the minimum of Also, it should be greater than |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "global/geospatial_lat_min.json", | ||
| "title": "geospatial_lat_min", | ||
| "description": "Specifies the southernmost latitude covered by the dataset. Units should be \"degrees North\" and values should be a number equal to or between -90 and 90.", | ||
| "examples": [ -90, -57.97 ], | ||
| "type": "number", | ||
| "maximum": 90, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See other comment, +90 seems odd for |
||
| "minimum": -90 | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "global/geospatial_lat_units.json", | ||
| "title": "geospatial_lat_units", | ||
| "description": "Units for the latitude axis described in \"geospatial_lat_min\" and \"geospatial_lat_max\" attributes. These should be \"degrees_north\".", | ||
| "examples": [ "degrees_north" ], | ||
| "type": "string", | ||
| "pattern": "degrees_north" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "global/geospatial_lon_max.json", | ||
| "title": "geospatial_lon_max", | ||
| "description": "Specifies the easternmost longitude covered by the dataset. Units should be \"degrees East\" and values should be a number equal to or between -180 and 180. Cases where geospatial_lon_min is greater than geospatial_lon_max indicate the bounding box extends from geospatial_lon_max, through the longitude range discontinuity meridian, the antimeridian for -180:180 values, to geospatial_lon_min; for example, geospatial_lon_min=170 and geospatial_lon_max=-175 incorporates 15 degrees of longitude (ranges 170 to 180 and -180 to -175).", | ||
| "examples": [ 180, -152.61 ], | ||
| "type": "number", | ||
| "maximum": 180, | ||
| "minimum": -180 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "global/geospatial_lon_min.json", | ||
| "title": "geospatial_lon_min", | ||
| "description": "Specifies the westernmost latitude covered by the dataset. Units should be \"degrees East\" and values should be a number equal to or between -180 and 180. See also geospatial_lon_max.", | ||
| "examples": [ -180, 88.48 ], | ||
| "type": "number", | ||
| "maximum": 180, | ||
| "minimum": -180 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "global/geospatial_lon_units.json", | ||
| "title": "geospatial_lon_units", | ||
| "description": "Units for the longitude axis described in \"geospatial_lon_min\" and \"geospatial_lon_max\" attributes. These should be \"degrees_east\".", | ||
| "examples": [ "degrees_east" ], | ||
| "type": "string", | ||
| "pattern": "degrees_east" | ||
| } |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should there be (failing) tests where require fields are missing and/or have incorrect values? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reduce the possibility of supply-chain injection attacks we use commit hashes rather than versions for all actions not owned by us or GitHub.