-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#8 - add schema-level and service-level handling of multiple content …
…types still need to add protocol-level and message-level handling Signed-off-by: Lance Drane <[email protected]>
- Loading branch information
1 parent
ef2b56e
commit dcd536e
Showing
30 changed files
with
324 additions
and
248 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,27 +1,48 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING, Any, Callable, NamedTuple | ||
from typing import TYPE_CHECKING, Any, Literal, NamedTuple | ||
|
||
if TYPE_CHECKING: | ||
from pydantic import TypeAdapter | ||
|
||
from ..core_definitions import IntersectDataHandler, IntersectMimeType | ||
|
||
|
||
class FunctionMetadata(NamedTuple): | ||
"""Internal cache of public function metadata. | ||
NOTE: both this class and all properties in it should remain immutable after creation | ||
""" | ||
|
||
method: Callable[[Any], Any] | ||
request_adapter: TypeAdapter[Any] | Literal[0] | None | ||
""" | ||
Type adapter for serializing and validating requests. | ||
Null if user did not specify a request parameter. | ||
0 if user did specify a request parameter, but Content-Type does not require a TypeAdapter. | ||
""" | ||
The raw method of the function. The function itself is useless and should not be called, | ||
but will store user-defined attributes needed for internal handling of data. | ||
response_adapter: TypeAdapter[Any] | Literal[0] | ||
""" | ||
request_adapter: TypeAdapter[Any] | None | ||
Type adapter for serializing and validating responses. | ||
0 if Content-Type does not require a TypeAdapter. | ||
""" | ||
Type adapter for serializing and validating requests. Should only be null if user did not specify a request parameter. | ||
request_content_type: IntersectMimeType | ||
""" | ||
response_adapter: TypeAdapter[Any] | ||
Content-Type of the request value | ||
""" | ||
Type adapter for serializing and validating responses. | ||
response_content_type: IntersectMimeType | ||
""" | ||
Content-Type of the response value | ||
""" | ||
response_data_transfer_handler: IntersectDataHandler | ||
""" | ||
How we intend on handling the response value | ||
""" | ||
strict_validation: bool | ||
""" | ||
Whether or not we're using lenient Pydantic validation (default, False) or strict | ||
""" | ||
shutdown_keys: set[str] | ||
""" | ||
keys which should cause the function to be skipped if set | ||
""" |
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
Oops, something went wrong.