Skip to content

Commit

Permalink
Merge pull request #557 from tjhei/schema-allow-schema
Browse files Browse the repository at this point in the history
json schema: allow $schema
  • Loading branch information
gassmoeller authored Feb 13, 2024
2 parents 05df5d4 + 9598441 commit a9ea2dc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/world_builder/world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ namespace WorldBuilder

prm.declare_entry("version", Types::String(""),"The major and minor version number for which the input file was written.");

prm.declare_entry("$schema", Types::String(""),"The optional filename or https address to a JSON schema file");

prm.declare_entry("cross section", Types::Array(Types::Point<2>(),2,2),"This is an array of two points along where the cross section is taken");

prm.declare_entry("potential mantle temperature", Types::Double(1600),
Expand Down
5 changes: 5 additions & 0 deletions tests/gwb-dat/world_builder_declarations.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"type": "string",
"documentation": "The major and minor version number for which the input file was written."
},
"$schema": {
"default value": "",
"type": "string",
"documentation": "The optional filename or https address to a JSON schema file"
},
"cross section": {
"type": "array",
"minItems": 2,
Expand Down
8 changes: 8 additions & 0 deletions tests/gwb-dat/world_builder_declarations_closed.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
- **documentation**:The major and minor version number for which the input file was written.
::::::::::::::::::::::::

::::::::::::::::::::::::{dropdown} /$schema
:name: closed_$schema

- **default value**:
- **type**:string
- **documentation**:The optional filename or https address to a JSON schema file
::::::::::::::::::::::::

::::::::::::::::::::::::{dropdown} /cross section
:name: closed_cross-section

Expand Down
9 changes: 9 additions & 0 deletions tests/gwb-dat/world_builder_declarations_open.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
- **documentation**:The major and minor version number for which the input file was written.
::::::::::::::::::::::::

::::::::::::::::::::::::{dropdown} /$schema
:open:
:name: open_$schema

- **default value**:
- **type**:string
- **documentation**:The optional filename or https address to a JSON schema file
::::::::::::::::::::::::

::::::::::::::::::::::::{dropdown} /cross section
:open:
:name: open_cross-section
Expand Down

0 comments on commit a9ea2dc

Please sign in to comment.