Replies: 2 comments 9 replies
-
Hey @nlykkei! None is technically null when serialized/deserialized to/from JSON. I don't have context on the consumer, but I'd prefer always having a sane default like an empty {} which is also valid JSON instead. |
Beta Was this translation helpful? Give feedback.
9 replies
-
I'm closing this discussion as resolved. Please reopen if you need. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Suppose I enable data validation for my
APIGatewayRestResolver
as follows:app = APIGatewayRestResolver(enable_validation=True)
I want to convert the original response to something that's accepted by the data validater:
Original response:
Response(status_code=HTTPStatus.OK, content_type=content_types.TEXT_PLAIN, body="")
My first attempt is as follows:
It works, as a
null
is returned:However, it feel "hacked", as
None
is not PydanticBaseModel
, which is what the data validation feature expects?Beta Was this translation helpful? Give feedback.
All reactions