Adds smart json support for WTForms. Useful for when using WTForms with RESTful APIs.
I'm occasionally getting a RecursionError on an application of mine (reported by Sentry). The recursion happens on line 189 of the `wtforms_json/__init__.py` file: ``` if call_original_func: func(self, formdata, data=data) ``` My code that is triggering the error is quite simple: ``` @tips_blueprint.route('/', methods=['POST', 'PUT']) @oauth_provider.require_oauth() def post_data(): """Post new data.""" data = request.get_json() form = TipForm.from_json(data) ``` The data being submitted as json is very simple and a flat key/value pair - no nesting or anything like that: ``` { 'comp_code': 'randomcopcode', 'game_id': 5891, 'team_id': 4 } ``` The issue seems to be in the additional validation that happens in the `monkey_patch_field_process` function. The form itself is quite simple but does do some database checks for validation. However there are no loops in the form validation which means it is highly unlikely that it's an issue with the validation. Annoyingly, it's extremely hard to pin down the exact cause of the issue. I can submit the same data multiple times and it will only trigger a recursion error every second or third time which I realise is very unhelpful. I just thought I'd post the issue here in case others were having the same problem or there was a known solution. I'm using: - Python 3.5.2 - Flask 0.12.2 - WTForms 2.1 - Flask-WTF 0.14.2 - WTForms-JSON 0.3.3
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by hammygoonan and has received 0 comments.