奶瓶+APISPEC+棉花糖集成

bottle-apispec的Python项目详细描述


瓶子符合规范

简单的插件,很容易使集成瓶,APISpec和棉花糖。

示例

frombottleimportBottle,runfrombottle_apispecimportAPISpecPluginfrommarshmallowimportSchemafrommarshmallow.fieldsimportStringapp=Bottle()classMySchema(Schema):id=String()value=String()@app.get('/')defindex():"""API endpoint that return MySchema    ---    get:        description: API endpoint that return MySchema        responses:            200:                description: It works!!!!                schema: MySchema    """data,error=MySchema.load('id','value')returndataapp.install(APISpecPlugin(title='Example API',version='1.0.0',openapi_version='2.0',scan_package='.'))run(app)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
字典java cassandra对象映射注释   java定制Solr TokenFilter lemmatizer   字符串从Java文件中读取windows文件名   java如何在Windows上设置StanfordCorenlp服务器以返回文本   java axis2“意外的子元素值”   java使用POI HSSF获取错误   多线程Java等待计时器线程完成   java ForkJoinPool BuffereImage处理风格   从java代码运行Python脚本   java将字节[]转换为短[],使每个短元素包含13位数据   java如何为swing jframe应用程序将代码划分为类   java使用okhttp更改baseurl   java AlertDialog。建设者setView导致堆栈溢出错误   java如何在特定的radius 安卓 studio中接收地址列表?