All Projects → marshmallow-code → apispec-webframeworks

marshmallow-code / apispec-webframeworks

Licence: MIT license
Web framework plugins for apispec (formally in apispec.ext).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to apispec-webframeworks

sticker
Sticker is a powerful yet boilerplate-free alternative to writing your web API.
Stars: ✭ 26 (+4%)
Mutual labels:  openapi, tornado, bottle
falcon-apispec
apispec plugin that generates OpenAPI specification (aka Swagger Docs) for Falcon web applications.
Stars: ✭ 44 (+76%)
Mutual labels:  openapi, apispec
spectree
API spec validator and OpenAPI document generator for Python web frameworks.
Stars: ✭ 190 (+660%)
Mutual labels:  openapi, apispec
whook
Build strong and efficient REST web services.
Stars: ✭ 18 (-28%)
Mutual labels:  openapi
main
Mocks Server monorepo
Stars: ✭ 109 (+336%)
Mutual labels:  openapi
Ktor-OpenAPI-Generator
Ktor OpenAPI/Swagger 3 Generator
Stars: ✭ 203 (+712%)
Mutual labels:  openapi
HibiAPI
一个实现了多种常用站点的易用化API的程序 / A program that implements easy-to-use APIs for a variety of commonly used sites.
Stars: ✭ 427 (+1608%)
Mutual labels:  openapi
go-fastapi
Create an API and get Swagger definition for free
Stars: ✭ 76 (+204%)
Mutual labels:  openapi
serverless-openapi-documentation
Serverless 1.0 plugin to generate OpenAPI V3 documentation from serverless configuration
Stars: ✭ 83 (+232%)
Mutual labels:  openapi
oas
OpenAPI Spec builder in go
Stars: ✭ 15 (-40%)
Mutual labels:  openapi
minter-go-sdk
Minter Blockchain Golang SDK, 💳 wallet, 🧾 transactions, gRPC and HTTP clients 🌐 https://t.me/MinterGoSDK
Stars: ✭ 12 (-52%)
Mutual labels:  openapi
openapi-generator-go
An opinionated OpenAPI v3 code generator for Go. Use this to generate API models and router scaffolding.
Stars: ✭ 42 (+68%)
Mutual labels:  openapi
laravel-openapi
Generate OpenAPI specification for Laravel Applications
Stars: ✭ 269 (+976%)
Mutual labels:  openapi
py-healthcheck
Write simple healthcheck functions for your Flask or Tornado apps.
Stars: ✭ 92 (+268%)
Mutual labels:  tornado
advanced-spring-scaffold
This project provides an advanced baseline to help you kick start a Spring project.
Stars: ✭ 21 (-16%)
Mutual labels:  openapi
fastapi-tortoise
The template for building scalable web APIs based on FastAPI, Tortoise ORM and other.
Stars: ✭ 95 (+280%)
Mutual labels:  openapi
sbt-guardrail
Principled code generation from OpenAPI specifications
Stars: ✭ 24 (-4%)
Mutual labels:  openapi
fixed-wing-sim
Matlab implementation to simulate the non-linear dynamics of a fixed-wing unmanned areal glider. Includes tools to calculate aerodynamic coefficients using a vortex lattice method implementation, and to extract longitudinal and lateral linear systems around the trimmed gliding state.
Stars: ✭ 72 (+188%)
Mutual labels:  tornado
ssc-restapi-client
Communicate with Fortify Software Security Center through REST API in java, a swagger generated client
Stars: ✭ 13 (-48%)
Mutual labels:  openapi
AlipayOpenapiCpp
支付宝开放平台的C\C++版接入示例代码,包含加签验签\网络请求\参数组装\报文解析等等;仅供商户或开发者参考使用;
Stars: ✭ 44 (+76%)
Mutual labels:  openapi

apispec-webframeworks

PyPI version Build status marshmallow 2/3 compatible code style: black

apispec plugins for integrating with various web frameworks.

These plugins used to be in apispec.ext but have since been moved to their own package.

Included plugins:

  • apispec_webframeworks.bottle
  • apispec_webframeworks.flask
  • apispec_webframeworks.tornado

Migration from apispec<1.0.0

To migrate from older versions of apispec, install this package with

pip install apispec-webframeworks

Change your imports, like so:

# apispec<1.0.0
from apispec.ext.flask import FlaskPlugin

# apispec>=1.0.0
from apispec_webframeworks.flask import FlaskPlugin

Example Usage

from flask import Flask
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from apispec_webframeworks.flask import FlaskPlugin
from marshmallow import Schema, fields

spec = APISpec(
    title="Gisty",
    version="1.0.0",
    info=dict(description="A minimal gist API"),
    plugins=[FlaskPlugin(), MarshmallowPlugin()],
)


app = Flask(__name__)


class GistParameter(Schema):
    gist_id = fields.Int()


class GistSchema(Schema):
    id = fields.Int()
    content = fields.Str()


@app.route("/gists/<gist_id>")
def gist_detail(gist_id):
    """Gist detail view.
    ---
    get:
        parameters:
                - in: path
                schema: GistParameter
        responses:
                200:
                schema: GistSchema
    """
    return "details about gist {}".format(gist_id)


# Since `path` inspects the view and its route,
# we need to be in a Flask request context
with app.test_request_context():
    spec.path(view=gist_detail)

Documentation

For documentation for a specific plugin, see its module docstring.

Development

  • Clone and cd into this repo
  • Create and activate a virtual environment
  • Install this package (in editable mode) and the development dependencies
$ pip install '.[dev]'
  • Install pre-commit hooks
$ pre-commit install

Running tests

To run all tests:

$ pytest

To run syntax checks:

$ tox -e lint

(Optional) To run tests in all supported Python versions in their own virtual environments (must have each interpreter installed):

$ tox

License

MIT licensed. See the bundled LICENSE file for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].