Open aderbas opened 4 weeks ago
Have you seen how I do this? https://github.com/miguelgrinberg/microblog-api/blob/main/api/users.py#L73.
The problem is in the values that come from the args
that are injected into the method def update(args)
I didn't want, for each view, to treat date fields.. When it is a date field it is already converted to python datetime
. When serializing within the schema, it gives an error.
The args that the endpoint receives are already parsed. You are trying to parse them again and that is why you get the error. Once again, have a look at my code, I do not have any issues with datetimes in updates, at least I don't think I do.
I'm trying to load the parameters coming from the PUT request into the schema.
input payload:
The problem here is that the
date_time_created
field in theargs
object is already converted todatetime
and marshmallow gives error:Is there any way for the date parameter to remain as a string? I'm using
request.json
to get around the problem but pylint complains about an unused variable (args in the method).I do not know if i was clear.