Python Falcon Part 4 - How to validated json input from your client

preview_player
Показать описание
Learn in this tutorial about how to fast validate the input your resived from the client, its importen its not crash your Falcon app so you shut be sure its json you resived and about the element/params in the json data are the right as you execpt.

This tutorial will help you to understand the issue and help you to fix the issues.

🔔🔔🔔 SUBSCRIBE to get more great videos from me 🔔🔔🔔

🌟 Community 🌟

Github:
Рекомендации по теме
Комментарии
Автор

self.__json_content.get() can be used instead of checking membership of 'name' in the dictionary. This way looks a bit more cleaner in the code.
Also we should object mappers like there's swagger which would map contracts to proper class instances from which you can read attributes during processing.

chintssats
Автор

This technique is not an actually validator deployment because you need to check field by field on JSON content, on every different route. What we really need is a middleware that handles all PUT, POST request and auto detect errors by pre-declared rules set.

liamnguyen
join shbcf.ru