All Projects → ampedandwired → Bottle Swagger

ampedandwired / Bottle Swagger

Licence: mit
A Bottle plugin for Swagger REST APIs

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Bottle Swagger

Spring Cloud Netflix Example
spring-cloud-netflix-example is an example for microservices system
Stars: ✭ 760 (+2823.08%)
Mutual labels:  swagger
Swagger Axios Converter
swagger axios converter
Stars: ✭ 16 (-38.46%)
Mutual labels:  swagger
Furion
Make .NET development easier, more versatile, and more popular.
Stars: ✭ 902 (+3369.23%)
Mutual labels:  swagger
Kin Openapi
OpenAPI 3.0 implementation for Go (parsing, converting, validation, and more)
Stars: ✭ 776 (+2884.62%)
Mutual labels:  swagger
Swagger To Graphql
Swagger to GraphQL API adapter
Stars: ✭ 811 (+3019.23%)
Mutual labels:  swagger
Aptos
☀️ Avro, Protobuf, Thrift on Swagger
Stars: ✭ 17 (-34.62%)
Mutual labels:  swagger
Mica
Spring Cloud 微服务开发核心工具集。工具类、验证码、http、redis、ip2region、xss 等,开箱即用。 🔝 🔝 记得右上角点个star 关注更新!
Stars: ✭ 749 (+2780.77%)
Mutual labels:  swagger
Spark Swagger
Spark (http://sparkjava.com/) support for Swagger (https://swagger.io/)
Stars: ✭ 25 (-3.85%)
Mutual labels:  swagger
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: ✭ 831 (+3096.15%)
Mutual labels:  swagger
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: ✭ 18 (-30.77%)
Mutual labels:  swagger
Schemathesis
A modern API testing tool for web applications built with Open API and GraphQL specifications.
Stars: ✭ 768 (+2853.85%)
Mutual labels:  swagger
Oapi Codegen
Generate Go client and server boilerplate from OpenAPI 3 specifications
Stars: ✭ 806 (+3000%)
Mutual labels:  swagger
Django Ninja
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
Stars: ✭ 875 (+3265.38%)
Mutual labels:  swagger
Optic
Optic documents and tests your API as you build it
Stars: ✭ 760 (+2823.08%)
Mutual labels:  swagger
Angular Asp.netcorewebapi Mysql Crud Project
Angular 5 + ASP.Net Core 2.0 WebAPI + MySQL CRUD Sample
Stars: ✭ 22 (-15.38%)
Mutual labels:  swagger
Javaquarkbbs
基于Spring Boot实现的一个简易的Java社区
Stars: ✭ 755 (+2803.85%)
Mutual labels:  swagger
Openapi Gui
GUI / visual editor for creating and editing OpenAPI / Swagger definitions
Stars: ✭ 891 (+3326.92%)
Mutual labels:  swagger
Auto Matching
Integrated Deai Engine(IDE: 統合出会い系エンジン)
Stars: ✭ 26 (+0%)
Mutual labels:  swagger
Viron
☕️ Automated Design-based Management Console.
Stars: ✭ 925 (+3457.69%)
Mutual labels:  swagger
Reitit
A fast data-driven router for Clojure/Script
Stars: ✭ 892 (+3330.77%)
Mutual labels:  swagger

===================== Bottle Swagger Plugin

About

This project is a Bottle plugin for working with Swagger. Bottle <http://bottlepy.org/>_ is a Python web framework. Swagger (OpenAPI) <http://swagger.io/>_ is a standard for defining REST APIs.

So if you are serving a REST API with Bottle, and you have a defined a Swagger schema for that API, this plugin can:

  • Validate incoming requests and outgoing responses against the swagger schema
  • Return appropriate error responses on validation failures
  • Serve your swagger schema via Bottle (for use in Swagger UI <http://swagger.io/swagger-ui/>_ for example)

Requirements

  • Python >= 2.7
  • Bottle >= 0.12
  • Swagger specification >= 2.0

This project relies on bravado-core <https://github.com/Yelp/bravado-core>_ to perform the swagger schema validation, so any version of the Swagger spec supported by that project is also supported by this plugin.

Installation

::

$ pip install bottle-swagger

Usage

See the "example" directory for a working example of using this plugin.

The simplest usage is::

import bottle

swagger_def = _load_swagger_def() bottle.install(SwaggerPlugin(swagger_def))

Where "_load_swagger_def" returns a dict representing your swagger specification (loaded from a yaml file, for example).

There are a number of arguments that you can pass to the plugin constructor:

  • validate_requests - Boolean (default True) indicating if incoming requests should be validated or not
  • validate_responses - Boolean (default True) indicating if outgoing responses should be validated or not
  • ignore_undefined_routes - Boolean (default False) indicating if undefined routes (that is, routes not defined in the swagger spec) should be passed on ("True") or return a 404 ("False")
  • invalid_request_handler - Callback called when request validation has failed. Default behaviour is to return a "400 Bad Request" response.
  • invalid_response_handler - Callback called when response validation has failed. Default behaviour is to return a "500 Server Error" response.
  • swagger_op_not_found_handler - Callback called when no swagger operation matching the request was found in the swagger schema. Default behaviour is to return a "404 Not Found" response.
  • exception_handler=_server_error_handler - Callback called when an exception is thrown by downstream handlers (including exceptions thrown by your code). Default behaviour is to return a "500 Server Error" response.
  • serve_swagger_schema - Boolean (default True) indicating if the Swagger schema JSON should be served
  • swagger_schema_url - URL (default /swagger.json) on which to serve the Swagger schema JSON

All the callbacks above receive a single parameter representing the Exception that was raised, or in the case of swagger_op_not_found_handler the Route that was not found. They should all return a Bottle Response object.

Contributing

Development happens in the bottle-swagger GitHub respository <https://github.com/ampedandwired/bottle-swagger>_. Pull requests (with accompanying unit tests), feature suggestions and bug reports are welcome.

Use "tox" to run the unit tests::

$ tox

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].