{"action":"closed","issue":{"url":"https://api.github.com/repos/nicolaiarocci/eve/issues/790","labels_url":"https://api.github.com/repos/nicolaiarocci/eve/issues/790/labels{/name}","comments_url":"https://api.github.com/repos/nicolaiarocci/eve/issues/790/comments","events_url":"https://api.github.com/repos/nicolaiarocci/eve/issues/790/events","html_url":"https://github.com/nicolaiarocci/eve/issues/790","id":124086196,"number":790,"title":"SCHEMA_ENDPOINT option does not work when schema has lambda coerce function.","user":{"login":"gwainer","id":2478582,"avatar_url":"https://avatars.githubusercontent.com/u/2478582?v=3","gravatar_id":"","url":"https://api.github.com/users/gwainer","html_url":"https://github.com/gwainer","followers_url":"https://api.github.com/users/gwainer/followers","following_url":"https://api.github.com/users/gwainer/following{/other_user}","gists_url":"https://api.github.com/users/gwainer/gists{/gist_id}","starred_url":"https://api.github.com/users/gwainer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwainer/subscriptions","organizations_url":"https://api.github.com/users/gwainer/orgs","repos_url":"https://api.github.com/users/gwainer/repos","events_url":"https://api.github.com/users/gwainer/events{/privacy}","received_events_url":"https://api.github.com/users/gwainer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nicolaiarocci/eve/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/nicolaiarocci/eve/milestones/15","html_url":"https://github.com/nicolaiarocci/eve/milestones/0.6.2","labels_url":"https://api.github.com/repos/nicolaiarocci/eve/milestones/15/labels","id":1388876,"number":15,"title":"0.6.2","description":null,"creator":{"login":"nicolaiarocci","id":512968,"avatar_url":"https://avatars.githubusercontent.com/u/512968?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolaiarocci","html_url":"https://github.com/nicolaiarocci","followers_url":"https://api.github.com/users/nicolaiarocci/followers","following_url":"https://api.github.com/users/nicolaiarocci/following{/other_user}","gists_url":"https://api.github.com/users/nicolaiarocci/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolaiarocci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolaiarocci/subscriptions","organizations_url":"https://api.github.com/users/nicolaiarocci/orgs","repos_url":"https://api.github.com/users/nicolaiarocci/repos","events_url":"https://api.github.com/users/nicolaiarocci/events{/privacy}","received_events_url":"https://api.github.com/users/nicolaiarocci/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":8,"state":"open","created_at":"2015-11-02T14:09:00Z","updated_at":"2016-01-20T16:44:24Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-12-28T16:12:43Z","updated_at":"2016-01-20T16:44:24Z","closed_at":"2016-01-20T16:44:24Z","body":"My Cerberus schema has in it a structure like this (irrelevant parts omitted):\r\n```python\r\nto_bool = lambda v: v if type(v) is bool else v.lower() in ['true', '1']\r\n\r\nschema = {\r\n(...)\r\n    'promotional_emails': {\r\n        'type': 'boolean',\r\n        'coerce': to_bool,\r\n        'default': False\r\n    },\r\n(...)\r\n}\r\n```\r\nI noticed that when I tried to set the SCHEMA_ENDPOINT option in settings.py with this schema, I got an error due to the `to_bool` function is not serializable. Partial error log below:\r\n\r\n```python\r\n  File \"/Users/g/.virtualenvs/api-env/lib/python3.5/site-packages/eve/io/mongo/mongo.py\", line 43, in default\r\n    return super(MongoJSONEncoder, self).default(obj)\r\n  File \"/Users/g/.virtualenvs/api-env/lib/python3.5/site-packages/eve/io/base.py\", line 36, in default\r\n    return json.JSONEncoder.default(self, obj)\r\n  File \"/Users/g/.virtualenvs/api-env/lib/python3.5/site-packages/simplejson/encoder.py\", line 252, in default\r\n    raise TypeError(repr(o) + \" is not JSON serializable\")\r\nTypeError: <function <lambda> at 0x10df32510> is not JSON serializable\r\n```\r\nIf I comment the `coerce` part from schema it works OK. "}}