Skip to content

Commit

Permalink
bump version (#340)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingy94@gmail.com>
  • Loading branch information
kemingy authored Sep 21, 2023
1 parent 63e62c5 commit 1228c46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "spectree"
version = "1.2.1"
version = "1.2.2"
dynamic = []
description = "generate OpenAPI document and validate request&response with Python annotations."
readme = "README.md"
Expand Down
16 changes: 7 additions & 9 deletions spectree/plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ def validate_response(
skip_validation: bool,
validation_model: OptionalModelType,
response_payload: Any,
):
"""Validate a given `response_payload` against a `validation_model`.
) -> ResponseValidationResult:
"""Validate a given ``response_payload`` against a ``validation_model``.
:param skip_validation: When set to true, validation is not carried out
and the input `response_payload` is returned as-is. This is equivalent
to not providing a `validation_model`.
and the input ``response_payload`` is returned as-is. This is equivalent
to not providing a ``validation_model``.
:param validation_model: Pydantic model used to validate the provided
`response_payload`.
:param response_payload: Validated response payload. A `RawResponsePayload`
``response_payload``.
:param response_payload: Validated response payload. A :class:`RawResponsePayload`
should be provided when the plugin view function returned an already
JSON-serialized response payload.
"""
Expand All @@ -163,9 +163,7 @@ def validate_response(
if isinstance(response_payload, validation_model):
skip_validation = True
final_response_payload = serialize_model_instance(response_payload)
elif is_root_model(validation_model) and not isinstance(
response_payload, validation_model
):
elif is_root_model(validation_model):
# Make it possible to return an instance of the model __root__ type
# (i.e. not the root model itself).
try:
Expand Down

0 comments on commit 1228c46

Please sign in to comment.