You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/01/26 11:21:23 UTC

[GitHub] [superset] michael-s-molina commented on pull request #18170: refactor: extract json_required view decorator

michael-s-molina commented on pull request #18170:
URL: https://github.com/apache/superset/pull/18170#issuecomment-1022106122


   Thank you for the PR @ad-m. Grabbing an example from Java, I really like the abstraction of `@Produces` and `@Consumes` annotations of [JAX-RS](https://docs.oracle.com/cd/E19798-01/821-1841/gipzh/index.html). They accept the MIME type as an argument.
   
   `@Consumes("application/json")`
   
   Since [request.is_json](https://flask.palletsprojects.com/en/2.0.x/api/#flask.Request.is_json) is pretty much checking the MIME type we could create a generic decorator the same way JAX-RS does. This will allow us to validate all request types in our endpoints.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org