Fixup `synapse.rest` to pass mypy.