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

How do I let my task-handler function accept a default POST request from GAE pushqueue

I am using python and flask rest_plus. I wrote a push task and pushed to a queue with GAE. By default the queue pushes the message of the task to the handler by a POST request. Is there a way I can make my task-handler function accept a POST request…
0
votes
1 answer

Validate json string against api.model

I want to post json along with image bytes. I'm using api.parser to specify expected parameters: upload_parser = api.parser() a=True upload_parser.add_argument('image', location='files', …
0
votes
1 answer

remove whitespace from JSON response by flask-restplus

How can you get rid of whitespace in the JSON response by flask-restplus routes? In a similar question, but for flask-restful instead of flask-restplus, the answer suggested setting the config option JSONIFY_PRETTYPRINT_REGULAR = False. This does…
Daniel Kats
  • 5,141
  • 15
  • 65
  • 102
0
votes
1 answer

Flask-Restful: can't parse args of json nested value

I've got the json { "message": { "foo": "foo", "bar": "bar" } } And parser: parser = reqparse.RequestParser(bundle_errors=True) parser.add_argument('foo', type=str, required=True) parser.add_argument('bar', type=str,…
Gary Ng
  • 413
  • 8
  • 16
0
votes
1 answer

Can't read from server. It may not have the appropriate access-control-origin settings | Google Cloud | Swagger

I am trying to deploy restful API on google cloud. The code is working fine on my local. However, after the successful deployment of my application on google cloud when I am hitting the project URL, I am getting the following error: Can't read…
0
votes
0 answers

How do we represent in swagger documentation how to pass jwt token to an endpoint?

On my Flask-restplus swagger documentation I have defined an endpoint that gets me list of public ip address, I have learned that I can define a model resource_fields = api.model('Resource', { 'name': fields.String, }) but I have also learned…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
0
votes
1 answer

How can I log marshaled messages sent by Flask-Restplus

Consider following bare minimum example: from flask_restplus import Api, Resource, fields from .models import User ns = api.namespace('users', description='User related operations') user = api.model('User', { 'id':…
StefanE
  • 7,578
  • 10
  • 48
  • 75
0
votes
1 answer

Flask-Restplus, changing content-type in swagger

I am using flask_restplus to generate swagger. I have to accept Content-Type: application/x-www-form-urlencoded on one of the POST endpoint. But the auto generated swagger document only shows applicatin/json. How can I change this behavior? Thanks.
Ravee
  • 11
  • 4
0
votes
1 answer

Flask-Restplus is not generating API documentation

Here are the relevant parts of app.py def init_api(): blueprint = Blueprint("api", __name__, url_prefix="/api/v1") api.init_app(blueprint) api.add_namespace(circuit_namespace) app.register_blueprint(blueprint) def init_api_auth(): …
conquester
  • 1,082
  • 2
  • 21
  • 44
0
votes
0 answers

File upload Error : FlaskRestful - Getting 400 for POST request

I am trying to upload a file through the post request in flask restfulplus I followed the example in this link Here is my code @ns.route('/upload/logo/') @ns.doc('Upload Logo') class UploadImage(Resource): @ns.param('picture', 'image file…
Tsubaki007
  • 47
  • 4
0
votes
0 answers

Flask Restplus : Sending DateTime as a parameter

@ns.param('startTime', 'The task identifier', type=datetime) def get(self): parser = reqparse.RequestParser() parser.add_argument('startTime', type = datetime) I want to send datetime as an argument for the GET request but it is giving me…
Tsubaki007
  • 47
  • 4
0
votes
1 answer

Deploying Flask_restplus Api build over Flask App using uwsgi.py on nginx server

All I have a flask_rest plus api over flask app in python. I want to deploy the same using the uwsgi format on nginx server. I searched for quite a long but didn't found the write solution.Any leads would be helpful.. Thanks in advance. Below is…
0
votes
1 answer

flask-restplus microservice not reachable on docker container

this is about a simple flask-restplus microservice with an echo endpoint, that can be found here that runs locally by default on port 5000: cd $src_folder python app.py but when running in a docker container with a simple Dockerfile... RUN pip…
0
votes
1 answer

Using Flask with Google App Engine Dev Server, swagger ui not found?

I am developing a website using Flask and Flask Restplus. I tried to use Google App Engine to deploy the app, however when I run dev_appserver.py on my computer, all the swagger-ui files cannot be found. I have no ideas why this happens? Can anyone…
Hà Link
  • 367
  • 1
  • 6
  • 20
0
votes
0 answers

Calling weather API in Restplus

I'm trying to figure out how can I call an API using Flask-Restplus (using API key, as it always was possible - let's say the easiest example is weather). I know how I can do it in Flask, but have no idea how can I do it in Restplus. There are tons…
Alice Jarmusch
  • 467
  • 1
  • 7
  • 20
1 2 3
21
22