diff --git a/jupyter_server/services/events/handlers.py b/jupyter_server/services/events/handlers.py index 611c571eb..8c8a59b7c 100644 --- a/jupyter_server/services/events/handlers.py +++ b/jupyter_server/services/events/handlers.py @@ -82,10 +82,10 @@ def validate_model( message = f"Missing `{key}` in the JSON request body." raise Exception(message) schema_id = cast(str, data.get("schema_id")) - version = cast(int, data.get("version")) schema = registry.get(schema_id) - if schema.version != version: - message = f"Unregistered version: `{version}` for `{schema_id}`" + version = int(data.get("version")) + if cast(int, schema.version) != version: + message = f"Unregistered version: {version}≠{schema.version} for `{schema_id}`" raise Exception(message)