Skip to content

Commit f3e3bc1

Browse files
Merge branch 'main' into adj-validator-new-version
2 parents 3e1e4a8 + a85513c commit f3e3bc1

File tree

1 file changed

+20
-0
lines changed
  • .github/workflows/scripts/adj-tester

1 file changed

+20
-0
lines changed

.github/workflows/scripts/adj-tester/main.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,26 @@ def check_packet_json(
448448
)
449449
is_valid = False
450450

451+
# Ensure that if one of period_type, period, socket is present, all must be present
452+
has_period_type = "period_type" in pkt
453+
has_period = "period" in pkt
454+
has_socket = "socket" in pkt
455+
456+
# Count how many of the three fields are present
457+
fields_present = sum([has_period_type, has_period, has_socket])
458+
459+
# If any field is present, all three must be present
460+
if fields_present > 0 and fields_present < 3:
461+
error_list.append(
462+
logError(
463+
path,
464+
f"id {pkt_id}",
465+
f"Fields 'period_type', 'period', and 'socket' must all be present together or all be absent. "
466+
f"Found: period_type={has_period_type}, period={has_period}, socket={has_socket}",
467+
)
468+
)
469+
is_valid = False
470+
451471
except RuntimeError as e:
452472
error_list.append(logError(path, "<load>", str(e)))
453473
is_valid = False

0 commit comments

Comments
 (0)