Questions tagged [flask-apispec]

19 questions
3
votes
1 answer

flask-apispec not populating kwargs with values from GET query (implementation of example code from documentation)

I am using flask-apispec with webargs to define the types of a simple API. I have produced a minimal example, below, that reproduces the issue, which is that the kwargs object is empty. Server code: import flask from flask_apispec import…
Ian Fiddes
  • 2,821
  • 5
  • 29
  • 49
3
votes
1 answer

Return values are not shown in Swagger-UI

I have created a very simple demo to demonstrate that the return values are not shown in…
Houman
  • 64,245
  • 87
  • 278
  • 460
2
votes
1 answer

@use_kwargs changes response content

I notice that @use_kwargs in flask-apispec changes the response content-type. In the following "hello world" example, The use of @use_kwargs changes the response content-type from text/html to application/json. I find it a bit surprising since the…
sgu
  • 1,301
  • 1
  • 13
  • 25
1
vote
1 answer

AttributeError: module 'flask.views' has no attribute 'MethodViewType'

Since two days ago I receive this the moment I try to import flask_apispec.extension: >>> import flask_apispec.extension Traceback (most recent call last): File "", line 1, in File…
Cos
  • 1,649
  • 1
  • 27
  • 50
1
vote
0 answers

Swagger Documentation with flask_apispec = array of objects

so I'm having an annoying problem with my flask_apispec documenter. I want the post body of my api to receive this in kwargs: [ { "CreatedUserGuid": "string", "DeviceGuid": "string", "DeviceMetaDataGuid": "string", …
1
vote
0 answers

Flask-RESTplus Upload image with token authentication

I make simple Flask REST-API app. There are just two fields: upload_parser.add_argument('photo', location='files', type=FileStorage) upload_parser.add_argument('group', location='form', choices=[1,2,3], help='Bad value for group') Everything works…
0
votes
0 answers

user_delete_connector() got an unexpected keyword argument 'id'

I have these two methods, while in the getall connector it does not require any parameter from the URL so its working fine. But when I'm trying the same for delete connector it is giving me error: user_delete_connector() got an unexpected keyword…
0
votes
0 answers

FlaskAPI - AttributeError: module 'app.routers.api' has no attribute 'register'

4 I am trying to setup an app using Flas API but keep getting this error which I can't make sense of. My api.py file is as follows: from flask import Blueprint, request from app.models import User from app.db import get_db bp = Blueprint('api',…
0
votes
0 answers

TypeError: The view function for 'create_emp' did not return a valid response. The function either returned None or ended without a return statement

Whenever i run the flask API to inserting the data using postman, but valid response not return response coming, Method : Post Postman input : http://127.0.0.1:5000/create **Body : ** { "address":"India", "email":"abb@gmail.com", …
0
votes
0 answers

Why is it impossible to get my favicon in flask_restful and apispec swagger ui?

I'm trying to build a restful api in python using flask and flask_restful also I use flask_apispec to build a swagger documentation. I want to use my favicon that is in my static/ folder but when I run my app I get this error message…
lolozen
  • 386
  • 1
  • 4
  • 19
0
votes
1 answer

Running ApiSpec with Flask and Swagger UI

I am trying to render my API's in Swagger. I am using ApiSpec library to generate the Open Api Spec, which then I trying to add into my Swagger UI. I am trying to use MethodView available in Flask with the following code below. from flask.views…
Harshita
  • 57
  • 8
0
votes
1 answer

flask_apispec library makes Flask app to crash when use_kwargs decorator is used

I am building a Restful API in Python 3.8 using flask_restful, flask_apispec, and marshmallow. When I enable use_kwargs decorator my app is crushing on a POST with TypeError: post() takes 1 positional argument but 2 were given I'd appreciate any…
Vasyl Herman
  • 414
  • 2
  • 11
0
votes
1 answer

How to validate Fields.Raw in Flask Marshmallow

I'm trying to set up a Webservice that accepts Images via POST methods. I'm using Python Flask as well as Flask-Apispec to create a Swagger documentation. I thus include this Marshmallow Schema to define which parameters are accepted: class…
0
votes
0 answers

Create a yaml flow collection using PyYAML in Python

I'm attempting to reproduce this YAML variable using PyYAML's dump: x-google-backend: address: https://www.google.com path_translation: [ APPEND_PATH_TO_ADDRESS ] Specifically the path_translation: [ APPEND_PATH_TO_ADDRESS ] is what I can't…
MarkyDD
  • 272
  • 5
  • 16
0
votes
1 answer

Why does apispec validation fail on format similar to documentation example for Python Flask API backend?

I am using apispec in a Python/Flask API backend. i followed the format found in the apispec documentation example. See: https://apispec.readthedocs.io/en/latest/ Can anyone tell me why I am getting a validation error with the below json schema and…
1
2