From 3e2286cbf8038e81f6c21ff2fa7c4d027327ac25 Mon Sep 17 00:00:00 2001 From: Rick Mouritzen <129233333+rmouritzen-splunk@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:55:29 -0800 Subject: [PATCH] Support change to enum value definitions (#35) --- ocsf_validator/types.py | 26 ++++++++++++++++---------- pyproject.toml | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ocsf_validator/types.py b/ocsf_validator/types.py index 331c16d..d373c67 100644 --- a/ocsf_validator/types.py +++ b/ocsf_validator/types.py @@ -24,16 +24,6 @@ class OcsfVersion(TypedDict): version: str -class OcsfEnumMember(TypedDict): - caption: str - description: NotRequired[str] - notes: NotRequired[str] - - -class OcsfEnum(TypedDict): - enum: Dict[str, OcsfEnumMember] - - class OcsfDeprecationInfo(TypedDict): message: Required[str] since: Required[str] @@ -47,6 +37,22 @@ class OcsfReference(TypedDict): OcsfReferences = Sequence[OcsfReference] +OcsfEnumMember = TypedDict( + "OcsfEnumMember", + { + "@deprecated": NotRequired[OcsfDeprecationInfo], + "caption": str, + "description": NotRequired[str], + "source": NotRequired[str], + "references": NotRequired[OcsfReferences], + }, +) + + +class OcsfEnum(TypedDict): + enum: Dict[str, OcsfEnumMember] + + OcsfAttr = TypedDict( "OcsfAttr", { diff --git a/pyproject.toml b/pyproject.toml index 5cec732..b9e5212 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ocsf-validator" -version = "0.2.2" +version = "0.2.3" description = "OCSF Schema Validation" authors = [ "Jeremy Fisher ",