Skip to main content

Questions tagged [flask-smorest]

The tag has no usage guidance.

flask-smorest
0 votes
3 answers
157 views

Issues in Streaming response from flask-smorest

I'm encountering issues in streaming response in flask-smorest. I'm following the guidance here - https://flask.palletsprojects.com/en/2.3.x/patterns/streaming/ for streaming responses from my flask-...
FahdS's user avatar
  • 49
0 votes
1 answer
33 views

Authorization header not displaying in the flask_smorest blueprints

I have a flask app that using the flask_smorest, pyJWT, flask_sqlalchemy and etc.. and I am creating the route /me to get current user details but when I hit that url using postman it works fine with ...
Nitin Namdev's user avatar
0 votes
1 answer
37 views

How to Properly Document Flask 'abort' Method Errors in Swagger UI with Default Error Schema

I had no problems using the abort method as a way to stop the flow of an application and display a message, for example abort(401, message='Your entry is not authorized') but what I am not achieving ...
Martin's user avatar
  • 17
0 votes
0 answers
148 views

Locally works but on the Nginx server I get: `Unable to render this definition. The provided definition does not specify a valid version field`

I have a Flask / Flask-Smorest application which when deployed locally the swagger UI and Open API show correctly. However, when deployed on the Cloud onto Nginx then it produces the output: Unable to ...
SkyWalker's user avatar
  • 14.1k
0 votes
0 answers
117 views

How to add structure to my api responses, I already have schemas defined

I have an api project which uses flask smorest and marshmallow. This is one of endpoints: @blp.route("/posts/<int:post_id>") class IndividualPost(MethodView): @blp.response(200, ...
Alwin Joseph's user avatar
1 vote
0 answers
120 views

flask_smorest swagger-ui get parameter description

I am using FLASK smores form my RESTapi application an have problem with documentation. I would like to have custom text in description field with name of possible parameters an default one. Swagger @...
Pawel's user avatar
  • 11
0 votes
1 answer
105 views

url_for function not working in flask application

This is my app.py: from flask import Flask from flask_smorest import Api from db import db from routes import blp as RoutesBlueprint def create_app(): app = Flask(__name__) app.config["...
polkamonster's user avatar
0 votes
1 answer
623 views

Flask-smorest returning an empty json string

The JSON response of my endpoint returns {} even though I am logging the correct data. from flask_smorest import Blueprint bp = Blueprint("auth", __name__, url_prefix="/api/v1/auth/&...
spitfiredd's user avatar
  • 3,025
0 votes
1 answer
481 views

Error on docker ValueError: The name 'Items' is already registered for this blueprint. Use 'name=' to provide a unique name

I am currently building an API on VS Code using Python 3.11, Flask, Insomnia, and Docker. when I tried to create my resources file to use flask_smorest I am getting this error on Docker ValueError: ...
Val Kuikman's user avatar
0 votes
1 answer
855 views

flask-smorest response and return type different

I am learning/working on a Rest Api suing flask-smorest and adding the schema using marshmallow. Below is the code that I am confused with and have a question. Schemas.py class ...
Deepak_Spark_Beginner's user avatar
1 vote
0 answers
83 views

Adding flask-security-too routes to OpenAPI documentation generated by flask-smorest

To set up OpenAPI with flask-smorest, you need to import Api from flask_smorest, and pass Api the flask_app object. Then you use method register_blueprint to register blueprints, and that's it. from ...
Dev_Ian_T's user avatar
0 votes
1 answer
2k views

How to use a list of arguments with flask_smorest/marshmallow

I am trying to insert a collection of objects in a flask api. We use marshmallow for deserializing. My endpoint looks like this: @blp.arguments(SomeSchemas, location='json', as_kwargs=True) ...
Oskar's user avatar
  • 110
1 vote
1 answer
578 views

Using a custom parser with flask_smorest and/or marshmallow

I'm using flask-smorest, the Flask/Marshmallow-based REST API framework and would like to be able to parse requests made with the axios JavaScript library, specifically for arrays passed via the ...
Mathieu Dhondt's user avatar
2 votes
1 answer
749 views

Deserialize list of ids for many-to-many PUT operation

I have a User and Role model with a many-to-many relationship class User(BaseModel, TimestampableMixin): username = Column(String(MEDIUM_STRING_LENGTH), nullable=False, unique=True) roles = ...
Casey's user avatar
  • 395