Bottle + APISpec + Marshmallow integration
Project description
bottle-apispec
Simple plugin to easily enable integrate Bottle, APISpec and Marshmallow.
Example
from bottle import Bottle, run
from bottle_apispec import APISpecPlugin
from marshmallow import Schema
from marshmallow.fields import String
app = Bottle()
class MySchema(Schema):
id = String()
value = String()
@app.get('/')
def index():
"""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')
return data
app.install(APISpecPlugin(
title='Example API',
version='1.0.0',
openapi_version='2.0',
scan_package='.')
)
run(app)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bottle-apispec-0.9.0.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bottle-apispec-0.9.0.tar.gz.
File metadata
- Download URL: bottle-apispec-0.9.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a453eeaed2b16242de7d1278d79e7023524c9c86031d952ddb831e6ddfdfd1a7
|
|
| MD5 |
f5a86b0866c0bfdd18db0caa0455117d
|
|
| BLAKE2b-256 |
7468c64ec71e329aa32fa294a51d3197763b7901ea0b58603f443da475543fe4
|
File details
Details for the file bottle_apispec-0.9.0-py3-none-any.whl.
File metadata
- Download URL: bottle_apispec-0.9.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e5531f3bbb0223175ebbfc9c7c93cea5c3a1d86c21d946862ce9fe4db530313
|
|
| MD5 |
822f8aa535e23c18b6503f8a6706afec
|
|
| BLAKE2b-256 |
f93a75ecbd83ee2b73bd5203767ad260ff513d7810867af32e8e89eea0d05d49
|