On 1/18/22 2:11 PM, Stephen Daniel wrote:
The REST API documentation is a bit informal. As someone who is not familiar with mailman, and who doesn't know python, they are a bit of a slog.
Agreed. I guess we sort of assume that people dealing directly with the REST API are familiar with both.
It might be worth seeing if the code can be enhanced to allow the boolean values to be sent in using JSON booleans as well as JSON strings.
I think here we only have to deal with the REST API because other uses of as_boolean are all on strings that come from config files. We can't modify as_boolean directly, as it is part of a third party dependency and is intended to be used with config files, not JSON objects, but I think something like this will do it. ``` --- a/src/mailman/rest/helpers.py +++ b/src/mailman/rest/helpers.py @@ -249,6 +249,8 @@ class GetterSetter: """ if self.decoder is None: return value + if self.decoder is as_boolean and isinstance(value, bool): + return value return self.decoder(value) ``` Perhaps you could try to test that. I just created https://gitlab.com/mailman/mailman/-/issues/970 for this. It would help me in fixing this if you could provide a small piece of your code that throws the error. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan