little refactoring done
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user