Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new metadata attributes: source and references #34

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ocsf_validator/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ class OcsfDeprecationInfo(TypedDict):
since: Required[str]


class OcsfReference(TypedDict):
url: Required[str]
description: Required[str]


OcsfReferences = Sequence[OcsfReference]


OcsfAttr = TypedDict(
"OcsfAttr",
{
Expand All @@ -64,6 +72,8 @@ class OcsfDeprecationInfo(TypedDict):
"profile": NotRequired[Optional[Sequence[str]]],
"values": NotRequired[Sequence[Any]],
"@deprecated": NotRequired[OcsfDeprecationInfo],
"source": NotRequired[str],
"references": NotRequired[OcsfReferences],
},
)

Expand Down Expand Up @@ -135,6 +145,7 @@ class OcsfProfile(TypedDict):
"observables": NotRequired[Dict[str, int]],
"$include": NotRequired[Union[str, Sequence[str]]],
"@deprecated": NotRequired[OcsfDeprecationInfo],
"references": NotRequired[OcsfReferences],
},
)

Expand All @@ -155,6 +166,7 @@ class OcsfProfile(TypedDict):
"observables": NotRequired[Dict[str, int]],
"$include": NotRequired[Union[str, Sequence[str]]],
"@deprecated": NotRequired[OcsfDeprecationInfo],
"references": NotRequired[OcsfReferences],
},
)

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ocsf-validator"
version = "0.2.1"
version = "0.2.2"
description = "OCSF Schema Validation"
authors = [
"Jeremy Fisher <[email protected]>",
Expand All @@ -26,4 +26,4 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
profile = "black"
profile = "black"
Loading