Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jsonschema
fastjsonschema
wslink
websocket-client
25 changes: 4 additions & 21 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.12
# by the following command:
#
# pip-compile requirements.in
Expand All @@ -8,37 +8,20 @@ aiohttp==3.9.3
# via wslink
aiosignal==1.3.1
# via aiohttp
async-timeout==4.0.3
# via aiohttp
attrs==23.2.0
# via
# aiohttp
# jsonschema
# referencing
# via aiohttp
fastjsonschema==2.21.1
# via -r requirements.in
frozenlist==1.4.1
# via
# aiohttp
# aiosignal
idna==3.6
# via yarl
jsonschema==4.21.1
# via -r requirements.in
jsonschema-specifications==2023.12.1
# via jsonschema
multidict==6.0.5
# via
# aiohttp
# yarl
python-dotenv==1.0.1
# via -r requirements.in
referencing==0.33.0
# via
# jsonschema
# jsonschema-specifications
rpds-py==0.18.0
# via
# jsonschema
# referencing
websocket-client==1.7.0
# via -r requirements.in
wslink==1.12.4
Expand Down
9 changes: 5 additions & 4 deletions src/opengeodeweb_viewer/utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import json

# Third party imports
from jsonschema import validate
from jsonschema.exceptions import ValidationError
import fastjsonschema
from fastjsonschema import JsonSchemaException

# Local application imports

Expand All @@ -24,8 +24,9 @@ def get_schemas_dict(path):
def validate_schema(params, schema, prefix=""):
print(f"{prefix}{schema['rpc']}", f"{params=}", flush=True)
try:
validate(instance=params, schema=schema)
except ValidationError as e:
validate = fastjsonschema.compile(schema)
validate(params)
except fastjsonschema.JsonSchemaException as e:
print(f"Validation error: {e.message}", flush=True)
raise Exception(
{
Expand Down
Binary file modified src/tests/data/take_screenshot_with_background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/data/take_screenshot_with_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/data/take_screenshot_without_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.