Skip to content

Commit

Permalink
Merge branch 'next' into feat/is_saveable
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienChampagnol authored Nov 20, 2023
2 parents 4fcbce2 + 68ca7f9 commit 2971bae
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 9 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,13 @@ jobs:
if: steps.semantic-release.outputs.released == 'true'
run: |
python3 -m pip install twine
python3 -m twine upload --repository pypi dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
python3 -m twine upload --repository pypi dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
- name: Merge master -> next
if: github.ref == 'ref/head/master'
uses: devmasx/merge-branch@master
with:
type: now
from_branch: master
target_branch: next
github_token: ${{ github.token }}

7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,51 @@



## v2.1.0-rc.1 (2023-11-15)

### Feature

* feat(github_workflows): merge from master to next ([`a93888c`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/a93888c5c87d1a9b6a64401e9eb55d1bb7015d18))

### Unknown

* Merge pull request #38 from Geode-solutions/feat_merge_master_to_next ([`a164e0f`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/a164e0f925d22d0d9cfe3f59f34f1fb7d9e8cf74))


## v2.0.0 (2023-11-15)

### Unknown

* Merge pull request #37 from Geode-solutions/next

Next ([`6dff2e3`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/6dff2e38b731630c1c860c554d95c7cd4bfa43f0))

* Merge branch 'master' into next ([`3edcaab`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/3edcaab72afad23f4afd60b9f16686ce9cf1ac99))


## v2.0.0-rc.1 (2023-11-15)

### Breaking

* feat(validate_request):
add json schema into function

BREAKING CHANGE: Arguments changement(array to json schema) ([`2128439`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/21284396212fa6b689f778cf83a015cc5ff42a11))

### Unknown

* Merge pull request #36 from Geode-solutions/json_back

feat(validate_request):
add json schema into function

BREAKING CHANGE: Arguments changement(array to json schema) ([`06829f5`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/06829f5620a3c3d5ea24ebed51e64e94ad84b0b2))

* remove useless lines ([`ebbe0e8`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/ebbe0e850b45c703d1af157f3136274ae2711202))

* Json Back - Upgrade ([`c11c23d`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/c11c23d0c30f0ac25f89d3f28dce41dbde0fa6bd))


## v1.4.0 (2023-11-06)

### Unknown
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "OpenGeodeWeb-Back"
version = "1.4.0"
version = "2.1.0-rc.1"
dynamic = ["dependencies"]
authors = [
{ name="Geode-solutions", email="[email protected]" },
Expand Down
3 changes: 3 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ OpenGeode-Inspector
OpenGeode-Geosciences
OpenGeode-GeosciencesIO
Geode-Viewables
jsonschema
flask[async]
werkzeug
30 changes: 28 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --pre --resolver=backtracking requirements.in
Expand All @@ -8,7 +8,19 @@ geode-common==30.0.0rc7
# via geode-viewables
geode-viewables==2.1.4rc1
# via -r requirements.in
opengeode-core==14.9.4rc8
itsdangerous==2.1.2
# via flask
jinja2==3.1.2
# via flask
jsonschema==4.19.2
# via -r requirements.in
jsonschema-specifications==2023.7.1
# via jsonschema
markupsafe==2.1.3
# via
# jinja2
# werkzeug
opengeode-core==14.9.3
# via
# -r requirements.in
# geode-common
Expand All @@ -34,3 +46,17 @@ opengeode-io==6.2.2rc1
# -r requirements.in
# geode-viewables
# opengeode-inspector
referencing==0.30.2
# via
# jsonschema
# jsonschema-specifications
rpds-py==0.12.0
# via
# jsonschema
# referencing
typing-extensions==4.8.0
# via asgiref
werkzeug==3.0.1
# via
# -r requirements.in
# flask
13 changes: 8 additions & 5 deletions src/opengeodeweb_back/geode_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import opengeode as og
import pkg_resources
import werkzeug
from jsonschema import validate
from jsonschema.exceptions import ValidationError

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


def validate_request(request, variables_array):
def validate_request(request, schema):
json_data = request.get_json(force=True, silent=True)

if json_data is None:
flask.abort(400, f"No json sent")
json_data = {}

for variable in variables_array:
if variable not in json_data.keys():
flask.abort(400, f"No {variable} sent")
try:
validate(instance=json_data, schema=schema)
except ValidationError as e:
flask.abort(400, f"Validation error: {e.message}")


def geographic_coordinate_systems(geode_object: str):
Expand Down

0 comments on commit 2971bae

Please sign in to comment.