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
0 answers

Is there a way in flask-restplus to get all http methods in one function?

I am creating a proxy with flask-restplus and I want to handle all http methods with one function for example: this is my restplus class @api.route('/', defaults={'path': ''}) @api.route('/') class Access(Resource): @ip_limiter …
0
votes
1 answer

Convert json field in body to enum with flask-restx

I have the following api definition for flask-restx (though should also work with flask-restplus). Is there someway to convert the enum-field in the request body the the Enum MyEnum without too much overhead or using DAOs? class MyEnum(Enum): …
Teharez
  • 501
  • 8
  • 25
0
votes
1 answer

flask_restx fields.Raw does not allow None

I just switched from flaks_restplus to flask_restx. I start getting the marshal error. jsonschema.exceptions.ValidationError: None is not of type 'object' I defined this field in my modal, and the dict I passed in. "my_field": fields.Raw {...…
etlds
  • 5,810
  • 2
  • 23
  • 30
0
votes
1 answer

How to customize flask error: Missing required parameter in the JSON body or the post body or the query string

How to customize flask error: Missing required parameter in the JSON body or the post body or the query string I need to return a json format response like this: { 'Error': '{} is Missing', 'Code': 10000, 'xxxx.': "xxx" }
0
votes
1 answer

flask_restplus: unable to get flask_swagger_ui to work in conjunction with namespaces

We have a large flask_restplus application that's been in service for a year or so. We now would like to use flask_swagger_ui to work within this application to serve some statically generated swagger docs for part of the application. Our…
HippoMan
  • 2,119
  • 2
  • 25
  • 48
0
votes
0 answers

flask requests are not thread safe when we run it with gunicorn

I am running a flask application and using flask-RESTPlus as an extension to build REST APIs. I have a user API that retrieves user information from postgres and also reads related information Redis and sends back to the client. I am running my…
Sanjay
  • 1,958
  • 2
  • 17
  • 25
0
votes
2 answers

how to access 'api' instance in namespace class

I'm following the guide : https://flask-restplus.readthedocs.io/en/stable/scaling.html I define namespace in each namespace class and the 'api' is defined in init.py. In init.py from flask_restplus import Api from .AA import nsAA api =…
0
votes
1 answer

Marshmallow and Flask-RESTPlus, how should they be used along?

I'm using Flask-Restplus to marshal responses in a Flask server. I also began using this package to parse HTTP requests from the client, when I stumbled about this huge warning on their site: Warning The whole request parser part of Flask-RESTPlus…
Carmellose
  • 4,815
  • 10
  • 38
  • 56
0
votes
1 answer

Python reqparse.Add_arguments(Type) won't give me the correct type in my json request

so I have a problem. My JSON data is getting sent over as a full string but its an object. How do i send an object instead of a string through my request. My reqparser is setup like this search_parse =…
Rajivrocks
  • 141
  • 2
  • 13
0
votes
1 answer

EventBridge vs API Gateway

I am trying to learn how to work with AWS in the last few days, because I want to deploy some APIs. So far, I was learning how to use API Gateway with Lambda Functions and it seemed like a nice workflow. But, because I am writting my APIs with…
0
votes
1 answer

Using RequestParser from Flask to validate that float arguments fall within range

I am creating an API using Flask Restplus on Python that takes in a dictionary of location information ({lat: 10, lon:80}, for example), does some mathematical modelling, and outputs a result. I am currently using the RequestParser object to parse…
0
votes
1 answer

Run Flask Restplus APIs through Gunicorn

I have a sample Flask-RestPlus application as myapp.py: from flask import Flask from flask_restplus import Resource, API API = Api(version='1.0', title='my_routes') MY_NAMESPACE = API.namespace('v1.0/routes', description='v1.0 routes') def…
0
votes
1 answer

Why are my flask RESTplus models not registered

I have a Flask RESTplus code where I instantiated models in my "models.py" folder. I named all API models inside their respective Flask SQLAlchemy model classes For instance class User(db.Model): serializer = api.model("user", { "name" :…
C0l0red
  • 35
  • 1
  • 7
0
votes
1 answer

Storing and accessing dictionary data in Flask

I have a Flask RESTful service where I want to read a JSON file as a dictionary during initialization and later read data from it during certain GET requests. The dictionary would have to be updated once every day. This is what I tried using Flask…
emotionull
  • 595
  • 2
  • 8
  • 24
0
votes
1 answer

Only allow expected fields?

My model expects two fields, and I validate my endpoint with that model: config_model = api.model('Configuration', { 'cuvettes_count': fields.Integer, 'pipettes_count': fields.Integer }) # later class ConfigEndpoint(Resource): …
Jonathan Tuzman
  • 11,568
  • 18
  • 69
  • 129