Questions tagged [flasgger]

Easy OpenAPI specs and Swagger UI for your Flask API

Flasgger is a Flask extension to extract OpenAPI-Specification from all Flask views registered in your API.

Flasgger also comes with SwaggerUI embedded so you can access http://localhost:5000/apidocs and visualize and interact with your API resources.

Flasgger also provides validation of the incoming data, using the same specification it can validates if the data received as as a POST, PUT, PATCH is valid against the schema defined using YAML, Python dictionaries or Marshmallow Schemas.

Flasgger can work with simple function views or MethodViews using docstring as specification, or using @swag_from decorator to get specification from YAML or dict and also provides SwaggerView which can use Marshmallow Schemas as specification.

Flasgger is compatible with Flask-RESTful so you can use Resources and swag specifications together, take a look at restful example.

Flasgger also supports Marshmallow APISpec as base template for specification, if you are using APISPec from Marshmallow take a look at apispec example.

52 questions
0
votes
0 answers

addtionalProperties is not getting validated (flasgger==0.9.2)

schema: type: object additionalProperties: type: string but even {"key1":12,"asd":2121} is giving 200 response..its getting accepted...but this should not get accepted according to the schema
0
votes
1 answer

While using webargs flassger is looking for templates in lib/python3.6/site-packages/webargs

I am using flask-restful, webargs, marshmallow and flasgger. My code looks something like this: #flasgger_yamlsv2 dir is in resources, so is this method @swag_from('flasgger_yamlsv2/xyz.yml') #MySchema is a marshmallow…
ortiv
  • 171
  • 1
  • 7
0
votes
1 answer

How to register Swagger endpoints in Flasgger

Currently using Swagger/Flasgger/Flask to document APIs/routes in an app. # app.py from flask import Flask from flasgger import Swagger from myapp.blueprints.main import main app = Flask(__name__) app.register_blueprint(main) swag =…
diplosaurus
  • 2,538
  • 5
  • 25
  • 53
0
votes
2 answers

WSO2 API publish error for Flasgger Swagger File - schema/properties is unexpected

I have created an application using Python+Flask and Flasgger to create swagger page. Swagger is getting generated properly and is working fine. I am using WSO2 (v2.5.0) API manager and trying to add a new API using a Swagger URL(generated by above…
0
votes
1 answer

Building Flasgger/Swagger API in python3 exception

I am building a Flasgger/Swagger API in python. When I input the values into the parameters and execute the code I am seeing the following error. I have also share exception images. """Example endpoint returning a list of colors by value This is…
QAA
  • 81
  • 1
  • 5
0
votes
1 answer

Flasgger AttributeError: 'NoneType' object has no attribute 'get'?

When I try to access http://localhost:8000/apidocs/index.html I get the following error: 127.0.0.1 - - [31/Jan/2018 16:38:09] "GET /apidocs/index.html HTTP/1.1" 302 - 127.0.0.1 - - [31/Jan/2018 16:38:10] "GET /apidocs/ HTTP/1.1" 200 - 127.0.0.1 - -…
LoveMeow
  • 3,858
  • 9
  • 44
  • 66
0
votes
1 answer

Python into Debian package: No module named error

Following the guidelines to build Debian package from a Python files powered by Flassger. When running a build getting an error: ImportError: No module named swagger_spec_validator.util Which mean, that test.py doesn't see…
0leg
  • 13,464
  • 16
  • 70
  • 94
1 2 3
4