-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from reagento/fix/optional-field-skipping
allow skipping optional fields using polices
- Loading branch information
Showing
13 changed files
with
267 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from ..provider.essential import Mediator | ||
from ..provider.static_provider import StaticProvider, static_provision_action | ||
from .request_cls import UnboundOptionalPolicy, UnboundOptionalPolicyRequest | ||
|
||
|
||
class UnboundOptionalPolicyProvider(StaticProvider): | ||
def __init__(self, is_allowed: bool): | ||
self._is_allowed = is_allowed | ||
|
||
@static_provision_action | ||
def _outer_unbound_optional_policy( | ||
self, | ||
mediator: Mediator, | ||
request: UnboundOptionalPolicyRequest, | ||
) -> UnboundOptionalPolicy: | ||
return UnboundOptionalPolicy(is_allowed=self._is_allowed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.