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

ST110 - StrictAssetsModelingRuleSchema #4519

Merged
merged 7 commits into from
Sep 8, 2024

Conversation

rshunim
Copy link
Contributor

@rshunim rshunim commented Aug 25, 2024

Related Issues

relates: https://jira-dc.paloaltonetworks.com/browse/CIAC-7809

Description

Add StrictAssetsModelingRuleSchema pydantic object for ST110 validation

Copy link

Changelog(s) in markdown:

  • Added 'AssetsModelingRuleSchema' to the ST110 validation. #4519

@rshunim
Copy link
Contributor Author

rshunim commented Aug 25, 2024

I checked the new feature on ModelingRule Directory.
I also changed the json schema file for catching errors and it works as expected.

Copy link
Contributor

@dorschw dorschw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, please add a unit test since this isn't a standard ST110 case



class StrictAssetsModelingRuleSchema(BaseStrictModel):
__root__: Optional[Dict[constr(regex=r".+"), Dict[str, AssetType]]] = None # type:ignore[valid-type]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r".+" means a string that isn't empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, since the field can be everything
as it allows in the schema file

@rshunim rshunim requested a review from dorschw September 5, 2024 11:46
rshunim and others added 3 commits September 8, 2024 14:31
Co-authored-by: dorschw <81086590+dorschw@users.noreply.github.com>
Co-authored-by: dorschw <81086590+dorschw@users.noreply.github.com>
@rshunim rshunim merged commit a8e4357 into master Sep 8, 2024
25 checks passed
@rshunim rshunim deleted the assets_modeling_rule_schema_pydantic branch September 8, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants