RealLiuSha
V2EX  ›  Flask

关于 flask json data 校验

  •  
  •   RealLiuSha · Feb 27, 2017 · 2833 views
    This topic created in 3362 days ago, the information mentioned may be changed or developed.

    请问下,如何优雅的实现对 post json data 的 value 校验,比如:

    curl -X POST -d '{"string": "some string", "int": 987}' http://$host/$api_path
    

    目前我是使用 flask-restfulreqparse 来实现, 想请教下各位有啥其他办法能做这样的事情?

    3 replies    2017-02-27 18:12:55 +08:00
    messense
        1
    messense  
       Feb 27, 2017
    JSON Schema
    arischow
        2
    arischow  
       Feb 27, 2017 via iPhone
    marshmallow
    RealLiuSha
        3
    RealLiuSha  
    OP
       Feb 27, 2017
    @messense 这个棒棒的

    @arischow 谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3368 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 11:20 · PVG 19:20 · LAX 04:20 · JFK 07:20
    ♥ Do have faith in what you're doing.