little refactoring done

This commit is contained in:
Ayzen
2026-03-10 17:33:25 +03:00
parent 9c745f304e
commit 1f715ce22c
10 changed files with 520 additions and 245 deletions
@@ -6,16 +6,6 @@ from typing import Any
from python_app.models.run_config_schema import ComboModel, RingEndpointModel, SwitchModel
def as_dict(value: Any, context: str) -> dict[str, Any]:
"""Validate that a payload node is a JSON object and return it."""
if value is None:
return {}
if not isinstance(value, dict):
raise ValueError(f"{context} must be a JSON object")
return value
def load_switch_payload(
payload: dict[str, Any],
target: SwitchModel,