-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation for saveWebClientState, postMovie, and postScreenshot (#…
…390) * Add json schema for web client state * Update schemas * Add json validator to composer * Add schema validation test * Add web client state test * Add schema files in docroot * Update schemas * Add validation for post endpoints * update movie/screenshot schemas * ignore autogenerated docroot/schema folder * Add shebang and set -e to deploy.sh * Move schema files to docroot/schema * Update management/schema readme * Add generated image_layer.schema.json * Update validate.py to use local files * Use data provider for schema tests * Add expectExceptionMessage to WebClientTest
- Loading branch information
1 parent
580224c
commit bc7bca8
Showing
61 changed files
with
5,186 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,4 @@ docroot/docs/v2 | |
docroot/status.xml | ||
py_env | ||
py_venv_local_sunpy | ||
vendor | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://api.helioviewer.org/schema/celestial_bodies.schema.json", | ||
"title": "Celestial Bodies", | ||
"description": "State information for the celestial_bodies section of the Helioviewer UI", | ||
"additionalProperties": false, | ||
"properties": { | ||
"soho": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"soho-mercury-tree-label", | ||
"soho-venus-tree-label", | ||
"soho-mars-tree-label", | ||
"soho-jupiter-tree-label", | ||
"soho-saturn-tree-label", | ||
"soho-uranus-tree-label", | ||
"soho-neptune-tree-label", | ||
"soho-psp-tree-branch", | ||
"soho-psp-tree-label", | ||
"soho-psp-tree-trajectory" | ||
] | ||
} | ||
}, | ||
"stereo_a": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"stereo_a-mercury-tree-label", | ||
"stereo_a-earth-tree-label", | ||
"stereo_a-venus-tree-label", | ||
"stereo_a-mars-tree-label", | ||
"stereo_a-jupiter-tree-label", | ||
"stereo_a-saturn-tree-label", | ||
"stereo_a-uranus-tree-label", | ||
"stereo_a-neptune-tree-label", | ||
"stereo_a-psp-tree-branch", | ||
"stereo_a-psp-tree-label", | ||
"stereo_a-psp-tree-trajectory" | ||
] | ||
} | ||
}, | ||
"stereo_b": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"stereo_b-mercury-tree-label", | ||
"stereo_b-venus-tree-label", | ||
"stereo_b-earth-tree-label", | ||
"stereo_b-mars-tree-label", | ||
"stereo_b-jupiter-tree-label", | ||
"stereo_b-saturn-tree-label", | ||
"stereo_b-uranus-tree-label", | ||
"stereo_b-neptune-tree-label", | ||
"stereo_b-psp-tree-branch", | ||
"stereo_b-psp-tree-label", | ||
"stereo_b-psp-tree-trajectory" | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://api.helioviewer.org/schema/client_state.schema.json", | ||
"title": "Client State", | ||
"description": "State information used to initialize the helioviewer.org UI", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"date": { "type": "number" }, | ||
"centerX": { "type": "number" }, | ||
"centerY": { "type": "number" }, | ||
"imageScale": { "type": "number" }, | ||
"eventLayers": { | ||
"$ref": "https://api.helioviewer.org/schema/event_layers.schema.json" | ||
}, | ||
"imageLayers": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "https://api.helioviewer.org/schema/image_layer.schema.json" | ||
} | ||
}, | ||
"celestialBodies": { | ||
"$ref": "https://api.helioviewer.org/schema/celestial_bodies.schema.json" | ||
} | ||
}, | ||
"required": [ | ||
"date", | ||
"centerX", | ||
"centerY", | ||
"imageScale", | ||
"eventLayers", | ||
"imageLayers", | ||
"celestialBodies" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://api.helioviewer.org/schema/event_layers.schema.json", | ||
"title": "Event Layers", | ||
"description": "Contains visibility settings for multiple groups of events", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^[a-zA-Z_]{1,11}$": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": ["labels_visible", "layers"], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"enum": [ | ||
"HEK", | ||
"CCMC", | ||
"RHESSI" | ||
] | ||
}, | ||
"visible": { "type": "boolean" }, | ||
"labels_visible": { "type": "boolean" }, | ||
"markers_visible": { "type": "boolean" }, | ||
"layer_available_visible": { "type": "boolean" }, | ||
"layers": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": ["frms", "event_type", "event_instances"], | ||
"properties": { | ||
"frms": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^\\w+$", | ||
"minLength": 1, | ||
"maxLength": 30 | ||
} | ||
}, | ||
"open": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 1 | ||
}, | ||
"event_type": { | ||
"type": "string", | ||
"pattern": "^[A-Z0-9]{2}$", | ||
"maxLength": 2 | ||
}, | ||
"event_instances": { | ||
"type": "array", | ||
"maxItems": 20, | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[a-zA-Z-]{2}--[a-zA-Z0-9_]{1,30}--[a-zA-Z0-9_.\\()+]+$", | ||
"minLength": 1, | ||
"maxLength": 150 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.