Skip to content

Commit 2971bae

Browse files
Merge branch 'next' into feat/is_saveable
2 parents 4fcbce2 + 68ca7f9 commit 2971bae

File tree

7 files changed

+102
-9
lines changed

7 files changed

+102
-9
lines changed

.github/workflows/CD.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,13 @@ jobs:
2626
if: steps.semantic-release.outputs.released == 'true'
2727
run: |
2828
python3 -m pip install twine
29-
python3 -m twine upload --repository pypi dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
29+
python3 -m twine upload --repository pypi dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
30+
- name: Merge master -> next
31+
if: github.ref == 'ref/head/master'
32+
uses: devmasx/merge-branch@master
33+
with:
34+
type: now
35+
from_branch: master
36+
target_branch: next
37+
github_token: ${{ github.token }}
38+

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"."
4+
],
5+
"python.testing.unittestEnabled": false,
6+
"python.testing.pytestEnabled": true
7+
}

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,51 @@
22

33

44

5+
## v2.1.0-rc.1 (2023-11-15)
6+
7+
### Feature
8+
9+
* feat(github_workflows): merge from master to next ([`a93888c`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/a93888c5c87d1a9b6a64401e9eb55d1bb7015d18))
10+
11+
### Unknown
12+
13+
* Merge pull request #38 from Geode-solutions/feat_merge_master_to_next ([`a164e0f`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/a164e0f925d22d0d9cfe3f59f34f1fb7d9e8cf74))
14+
15+
16+
## v2.0.0 (2023-11-15)
17+
18+
### Unknown
19+
20+
* Merge pull request #37 from Geode-solutions/next
21+
22+
Next ([`6dff2e3`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/6dff2e38b731630c1c860c554d95c7cd4bfa43f0))
23+
24+
* Merge branch 'master' into next ([`3edcaab`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/3edcaab72afad23f4afd60b9f16686ce9cf1ac99))
25+
26+
27+
## v2.0.0-rc.1 (2023-11-15)
28+
29+
### Breaking
30+
31+
* feat(validate_request):
32+
add json schema into function
33+
34+
BREAKING CHANGE: Arguments changement(array to json schema) ([`2128439`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/21284396212fa6b689f778cf83a015cc5ff42a11))
35+
36+
### Unknown
37+
38+
* Merge pull request #36 from Geode-solutions/json_back
39+
40+
feat(validate_request):
41+
add json schema into function
42+
43+
BREAKING CHANGE: Arguments changement(array to json schema) ([`06829f5`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/06829f5620a3c3d5ea24ebed51e64e94ad84b0b2))
44+
45+
* remove useless lines ([`ebbe0e8`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/ebbe0e850b45c703d1af157f3136274ae2711202))
46+
47+
* Json Back - Upgrade ([`c11c23d`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/c11c23d0c30f0ac25f89d3f28dce41dbde0fa6bd))
48+
49+
550
## v1.4.0 (2023-11-06)
651

752
### Unknown

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "OpenGeodeWeb-Back"
8-
version = "1.4.0"
8+
version = "2.1.0-rc.1"
99
dynamic = ["dependencies"]
1010
authors = [
1111
{ name="Geode-solutions", email="[email protected]" },

requirements.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ OpenGeode-Inspector
44
OpenGeode-Geosciences
55
OpenGeode-GeosciencesIO
66
Geode-Viewables
7+
jsonschema
8+
flask[async]
9+
werkzeug

requirements.txt

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.9
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --pre --resolver=backtracking requirements.in
@@ -8,7 +8,19 @@ geode-common==30.0.0rc7
88
# via geode-viewables
99
geode-viewables==2.1.4rc1
1010
# via -r requirements.in
11-
opengeode-core==14.9.4rc8
11+
itsdangerous==2.1.2
12+
# via flask
13+
jinja2==3.1.2
14+
# via flask
15+
jsonschema==4.19.2
16+
# via -r requirements.in
17+
jsonschema-specifications==2023.7.1
18+
# via jsonschema
19+
markupsafe==2.1.3
20+
# via
21+
# jinja2
22+
# werkzeug
23+
opengeode-core==14.9.3
1224
# via
1325
# -r requirements.in
1426
# geode-common
@@ -34,3 +46,17 @@ opengeode-io==6.2.2rc1
3446
# -r requirements.in
3547
# geode-viewables
3648
# opengeode-inspector
49+
referencing==0.30.2
50+
# via
51+
# jsonschema
52+
# jsonschema-specifications
53+
rpds-py==0.12.0
54+
# via
55+
# jsonschema
56+
# referencing
57+
typing-extensions==4.8.0
58+
# via asgiref
59+
werkzeug==3.0.1
60+
# via
61+
# -r requirements.in
62+
# flask

src/opengeodeweb_back/geode_functions.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import opengeode as og
1212
import pkg_resources
1313
import werkzeug
14+
from jsonschema import validate
15+
from jsonschema.exceptions import ValidationError
1416

1517
# Local application imports
1618
from .geode_objects import geode_objects_dict
@@ -229,15 +231,16 @@ def extension_from_filename(filename):
229231
return os.path.splitext(filename)[1][1:]
230232

231233

232-
def validate_request(request, variables_array):
234+
def validate_request(request, schema):
233235
json_data = request.get_json(force=True, silent=True)
234236

235237
if json_data is None:
236-
flask.abort(400, f"No json sent")
238+
json_data = {}
237239

238-
for variable in variables_array:
239-
if variable not in json_data.keys():
240-
flask.abort(400, f"No {variable} sent")
240+
try:
241+
validate(instance=json_data, schema=schema)
242+
except ValidationError as e:
243+
flask.abort(400, f"Validation error: {e.message}")
241244

242245

243246
def geographic_coordinate_systems(geode_object: str):

0 commit comments

Comments
 (0)