Skip to content

Commit

Permalink
Support change to enum value definitions (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmouritzen-splunk authored Dec 11, 2024
1 parent 0be349f commit 3e2286c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
26 changes: 16 additions & 10 deletions ocsf_validator/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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",
{
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ocsf-validator"
version = "0.2.2"
version = "0.2.3"
description = "OCSF Schema Validation"
authors = [
"Jeremy Fisher <[email protected]>",
Expand Down

0 comments on commit 3e2286c

Please sign in to comment.