File tree Expand file tree Collapse file tree 3 files changed +23
-38
lines changed Expand file tree Collapse file tree 3 files changed +23
-38
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ geode-simplex
99geode-explicit
1010geode-implicit
1111geode-common
12- jsonschema
12+ fastjsonschema
1313Flask[async]
1414Flask-Cors
1515werkzeug
Original file line number Diff line number Diff line change 22# This file is autogenerated by pip-compile with Python 3.12
33# by the following command:
44#
5- # pip-compile requirements.in
5+ # pip-compile
66#
7- asgiref == 3.8 .1
7+ asgiref == 3.9 .1
88 # via flask
9- attrs == 25.3.0
10- # via
11- # jsonschema
12- # referencing
139blinker == 1.9.0
1410 # via flask
1511click == 8.2.1
1612 # via flask
13+ fastjsonschema == 2.21.1
14+ # via -r requirements.in
1715flask [async ]== 3.1.1
1816 # via
1917 # -r requirements.in
2018 # flask-cors
2119flask-cors == 6.0.1
2220 # via -r requirements.in
23- geode-background == 9.2.9
21+ geode-background == 9.3.3
2422 # via
2523 # geode-explicit
2624 # geode-implicit
2725 # geode-simplex
28- geode-common == 33.8.8
26+ geode-common == 33.8.12
2927 # via
3028 # -r requirements.in
3129 # geode-background
@@ -35,22 +33,22 @@ geode-common==33.8.8
3533 # geode-numerics
3634 # geode-simplex
3735 # geode-viewables
38- geode-conversion == 6.3.3
36+ geode-conversion == 6.3.5
3937 # via
4038 # geode-explicit
4139 # geode-implicit
42- geode-explicit == 6.2.3
40+ geode-explicit == 6.2.6
4341 # via
4442 # -r requirements.in
4543 # geode-implicit
46- geode-implicit == 3.9.4
44+ geode-implicit == 4.0.1
4745 # via -r requirements.in
48- geode-numerics == 6.2.2
46+ geode-numerics == 6.2.3
4947 # via
5048 # -r requirements.in
5149 # geode-implicit
5250 # geode-simplex
53- geode-simplex == 9.4.2
51+ geode-simplex == 9.5.3
5452 # via
5553 # -r requirements.in
5654 # geode-implicit
@@ -60,16 +58,12 @@ itsdangerous==2.2.0
6058 # via flask
6159jinja2 == 3.1.6
6260 # via flask
63- jsonschema == 4.24.0
64- # via -r requirements.in
65- jsonschema-specifications == 2025.4.1
66- # via jsonschema
6761markupsafe == 3.0.2
6862 # via
6963 # flask
7064 # jinja2
7165 # werkzeug
72- opengeode-core == 15.21.2
66+ opengeode-core == 15.21.7
7367 # via
7468 # -r requirements.in
7569 # geode-background
@@ -84,38 +78,28 @@ opengeode-core==15.21.2
8478 # opengeode-geosciencesio
8579 # opengeode-inspector
8680 # opengeode-io
87- opengeode-geosciences == 9.0.0
81+ opengeode-geosciences == 9.1.2
8882 # via
8983 # -r requirements.in
9084 # geode-implicit
9185 # geode-viewables
9286 # opengeode-geosciencesio
93- opengeode-geosciencesio == 5.4.2
87+ opengeode-geosciencesio == 5.4.3
9488 # via
9589 # -r requirements.in
9690 # geode-implicit
97- opengeode-inspector == 6.6.1
91+ opengeode-inspector == 6.6.4
9892 # via
9993 # -r requirements.in
10094 # geode-explicit
10195 # geode-implicit
10296 # geode-simplex
103- opengeode-io == 7.2.1
97+ opengeode-io == 7.2.3
10498 # via
10599 # -r requirements.in
106100 # geode-implicit
107101 # geode-viewables
108102 # opengeode-geosciencesio
109- referencing == 0.36.2
110- # via
111- # jsonschema
112- # jsonschema-specifications
113- rpds-py == 0.25.1
114- # via
115- # jsonschema
116- # referencing
117- typing-extensions == 4.14.0
118- # via referencing
119103werkzeug == 3.1.3
120104 # via
121105 # -r requirements.in
Original file line number Diff line number Diff line change 66
77# Third party imports
88import flask
9- from jsonschema import validate
10- from jsonschema .exceptions import ValidationError
9+ import fastjsonschema
10+ from fastjsonschema .exceptions import JsonSchemaDefinitionException
1111import importlib .metadata as metadata
1212
1313# Local application imports
@@ -82,9 +82,10 @@ def validate_request(request, schema):
8282 json_data = {}
8383
8484 try :
85- validate (instance = json_data , schema = schema )
86- except ValidationError as e :
87- flask .abort (400 , f"Validation error: { e .message } " )
85+ validate = fastjsonschema .compile (schema )
86+ validate (json_data )
87+ except fastjsonschema .JsonSchemaException as e :
88+ flask .abort (400 , f"Validation error: { str (e )} " )
8889
8990
9091def set_interval (func , sec , args = None ):
You can’t perform that action at this time.
0 commit comments