From 73331f28fd733f3adbb314e3934abcbd0d312ab4 Mon Sep 17 00:00:00 2001 From: Jordan Bradford <36420801+jrdnbradford@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:07:35 -0500 Subject: [PATCH] Use `anyOf` --- tljh/config_schema.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/tljh/config_schema.py b/tljh/config_schema.py index e6fb820..9d141c6 100644 --- a/tljh/config_schema.py +++ b/tljh/config_schema.py @@ -79,23 +79,16 @@ config_schema = { "description": "User CPU and memory limits.", "type": "object", "additionalProperties": False, - "properties": {"memory": {"type": "string"}, "cpu": { - "oneOf": [ - { - "type": "integer", - "minimum": 0 + "properties": { + "memory": {"type": "string"}, + "cpu": { + "anyOf": [ + {"type": "integer", "minimum": 0}, + {"type": "number", "minimum": 0}, + {"type": "string", "enum": ["None"]}, + ] }, - { - "type": "number", - "minimum": 0 - }, - { - "type": "string", - "enum": ["None"] - } - ] - } - }, + }, }, "UserEnvironment": { "type": "object",