Questions tagged [flask-restplus]

Flask-RESTPlus is an extension for Flask that adds support for quickly building REST APIs documented with Swagger

Flask-RestPlus provide syntaxic suger, helpers and automatically generated Swagger documentation on top of Flask-Restful. It provides a bunch of decorators and helpers to quickly build documented and maintainable APIs with Flask.

Website: https://flask-restplus.readthedocs.io/

330 questions
0
votes
1 answer

Simultaneously serving web pages and an API with Flask on different ports

I intend to serve a Flask API (powered by flask-restplus) on :5000, as well as a couple of web pages on :80 (which incidentally are Angular based consumers of the aforementioned API). Is this possible? If so, how doth one go about this?
Chris vCB
  • 1,023
  • 3
  • 13
  • 28
0
votes
1 answer

Flask restful model with variable keys

As a part of my RESTful API I found myself needing to return a json with "variable" keys, I'll try to make things more clear with a simple example: I have different groups, each group has a group_id, so the expected return would be: { 1: { …
Gal Pressman
  • 130
  • 1
  • 13
0
votes
1 answer

Testing routing Blueprint - Flask Restplus

I'm trying to test the example of ToDo in Flask-Restplus site, but it keeps on getting me 404... Basically I have 3 files: app.py import sys import os import platform import datetime import logging from logging import Formatter from…
AlejandroVK
  • 7,373
  • 13
  • 54
  • 77
0
votes
0 answers

Routing error when testing API made with Blueprint in Flask

I'm having troubles when testing an API made with Flask-Restplus, integrating it into an existing application. The structure (not complete, the relevant pieces) of the project is as follows (root folder is called portal) | |-api -> Blueprint…
AlejandroVK
  • 7,373
  • 13
  • 54
  • 77
0
votes
1 answer

multiples section on Restplus swagger documentation

On Restplus documentation (using B!ueprints) we see : a full example: https://flask-restplus.readthedocs.io/en/0.2.3/example.html The created swagger documentation has only one section "todos : TODO operations " How can I have multiples sections ?
user3313834
  • 7,327
  • 12
  • 56
  • 99
0
votes
0 answers

AssertionError with Flask-Restplus under Python 2.7

I am refactoring a Flask-restful app to Flask-RESTPlus in order to get the Swagger documentation easier integrated. I have defined endpoint, with a namespace and a model and I get the swagger UI up under http://localhost:8080/api and have the…
halloleo
  • 9,216
  • 13
  • 64
  • 122
0
votes
2 answers

Flask-restplus how to post without a body

I'd like to use the POST verb to perform actions on a VM with flask-restplus, but it always results in a 400 when there is no body. VM_ACTION_FIELDS = { 'vmActionId': fields.Integer(required=True, description='The vmActionId of the…
-1
votes
1 answer

AttributeErrors when serving with python3 instead of flask

Hello all and Happy Holidays, I am trying to serve a flask application via wsgi and nginx, because I read it's a much more safer way. I am currently following this guide ->…
-1
votes
2 answers

Python web application with flask on local machine

I'm new to python and Flask, and I have a project from the production ENV which I'm trying to run on my local. I was able to install all the packages and bring them up on http://127.0.0.1:5000, but the problem is that is the only page that actually…
Reza Shek
  • 581
  • 1
  • 8
  • 18
-1
votes
1 answer

How to use SELECT query based on method parameter in Flask restplus Api?

I want to handle a GET request in my Flask REST API.The request will include List parameter and I use this to be a typical GET request: https://localhost:5000/organisation?List=1 this request, will return all of Organisation Model information.…
mina
  • 153
  • 6
  • 18
-1
votes
1 answer

Flask-Restplus how to combine data from 2 table into single data response?

I am using Flask-Restplus and SQLAlchemy to develop my API. I want to return a response with information from two SQAlchemy objects, a user and a device, with a 1:1 relationship between them. I have a query that looks like this: details =…
ken
  • 2,426
  • 5
  • 43
  • 98
-1
votes
1 answer

Python threading script execution in Flask Backend

Currently i'm trying to use proper threading to execute a bunch of scripts. They are sorted like that: Main Thread (Runs the Flask app) -Analysis Thread (Runs the analysis script which invokes all needed scripts) -3 different functions…
-2
votes
1 answer

Unable to access endpoint on flask api

I am trying to build an api with flask and flask-restplus, it seems fine with no errors. When I launch the server, it look fine like this but whatever the uri, I try to test, it displays requested URL was not found on the server and do know how to…
Steve Ruben
  • 1,336
  • 11
  • 20
-2
votes
1 answer

why am I getting "Failed to decode JSON object: No JSON object could be decoded" error?

I have written this code below: @url_api.route("/add") class AddIPvFour(Resource): """ this class contains functions to add new url. """ def post(self): """ Add a new URL map to IP or update exisitng. …
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
1 2 3
21
22