Complete name-first 1C adapter saved-state support
This commit is contained in:
@@ -50,6 +50,8 @@ def run_checks() -> dict[str, Any]:
|
||||
PARSER / "__init__.py",
|
||||
PARSER / "payload.py",
|
||||
PARSER / "cas_payload.py",
|
||||
PARSER / "common_command.py",
|
||||
PARSER / "scheduled_job.py",
|
||||
]
|
||||
missing = [str(path.relative_to(ROOT)) for path in required if not path.exists()]
|
||||
require(not missing, f"missing standalone connector files: {missing}", failures)
|
||||
@@ -96,7 +98,35 @@ def run_checks() -> dict[str, Any]:
|
||||
require(openapi.get("openapi") == "3.1.0", "connector OpenAPI must parse as 3.1.0", failures)
|
||||
paths = openapi.get("paths") if isinstance(openapi.get("paths"), dict) else {}
|
||||
require("/health" in paths, "connector OpenAPI must expose /health", failures)
|
||||
require("/methods" in paths, "connector OpenAPI must expose runtime /methods registry", failures)
|
||||
require("/rpc" in paths, "connector OpenAPI must expose universal /rpc", failures)
|
||||
require("/metadata/write-plan" in paths, "connector OpenAPI must expose /metadata/write-plan", failures)
|
||||
schemas = ((openapi.get("components") or {}).get("schemas") or {}) if isinstance(openapi.get("components"), dict) else {}
|
||||
require("AdapterRpcRequest" in schemas, "connector OpenAPI must define AdapterRpcRequest", failures)
|
||||
require("AdapterMethodsResponse" in schemas, "connector OpenAPI must define AdapterMethodsResponse", failures)
|
||||
try:
|
||||
sys.path.insert(0, str(CONNECTOR))
|
||||
sys.path.insert(0, str(CONNECTOR.parent))
|
||||
import adapter_1c_server as adapter_server
|
||||
|
||||
runtime_paths = set(adapter_server.HTTP_GET_METHOD_ROUTES) | set(adapter_server.HTTP_POST_METHOD_ROUTES) | {"/rpc"}
|
||||
require(
|
||||
set(paths) == runtime_paths,
|
||||
f"OpenAPI/runtime HTTP route drift: missing_in_openapi={sorted(runtime_paths - set(paths))}, missing_in_runtime={sorted(set(paths) - runtime_paths)}",
|
||||
failures,
|
||||
)
|
||||
require(
|
||||
all("get" in (paths.get(path) or {}) for path in adapter_server.HTTP_GET_METHOD_ROUTES),
|
||||
"every runtime GET route must be declared as GET in OpenAPI",
|
||||
failures,
|
||||
)
|
||||
require(
|
||||
all("post" in (paths.get(path) or {}) for path in adapter_server.HTTP_POST_METHOD_ROUTES),
|
||||
"every runtime POST route must be declared as POST in OpenAPI",
|
||||
failures,
|
||||
)
|
||||
except Exception as exc:
|
||||
failures.append(f"could not verify runtime HTTP route registry: {exc}")
|
||||
|
||||
return {
|
||||
"schema": "onec_connector_standalone_check.v1",
|
||||
|
||||
Reference in New Issue
Block a user