@user_required
def post(self, user):
    schema = {'type': 'object', 'properties': {'name': {'type': 'string'}, 'description': {'type': 'string'}, 'words': {'type': 'array', 'items': {'type': 'string'}, 'uniqueItems': True}}}
    try:
        body = request.json
        validate(instance=body, schema=schema)
        (wordok, not_has, wnot_has) = models.WordList.check_word(*body['words'])
        body['words'] = list(wordok)
        wordlist = models.WordList(**body)
        wordlist.user = user
        wordlist.save()
        return {'message': 'ok', 'has': list(wordok), 'not_dict': wnot_has, 'not_sentence': not_has}
    except Exception as err:
        return ({'message': 'invalid request body', 'error': str(err)}, 422)
@user_required
def post(self, user):
    schema = {'type': 'object', 'properties': {'name': {'type': 'string'}, 'description': {'type': 'string'}, 'words': {'type': 'array', 'items': {'type': 'string'}, 'uniqueItems': True}}}
    try:
        body = request.json
        validate(instance=body, schema=schema)
        (wordok, not_has, wnot_has) = models.WordList.check_word(*body['words'])
        body['words'] = list(wordok)
        wordlist = models.WordList(**body)
        wordlist.user = user
        wordlist.save()
        return {'message': 'ok', 'has': list(wordok), 'not_dict': wnot_has, 'not_sentence': not_has}
    except Exception as err:
        return ({'message': 'invalid request body', 'error': str(err)}, 422)