Connexion is a framework that automagically handles HTTP requests based on OpenAPI Specification (formerly known as Swagger Spec) of your API described in YAML format.
Questions tagged [connexion]
151 questions
0
votes
0 answers
Unittest for app using Connexion and Flask for test upload API
I have an app with this unit test file:
from webtest import TestApp
import unittest
from app import app
class UploadUnitTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.app = TestApp(app)
def…

user907988
- 625
- 1
- 5
- 17
0
votes
1 answer
How to pass variables to a openapi python flask controller?
I use the generated openapi python flask server (generated by openapi-generator-cli-4.2.3.jar) in a larger python project. One of the openapi controllers needs access to my database. Another controller needs a list of objects. Both information are…
0
votes
1 answer
How to fix this error? Failed validating 'oneOf' in schema
I am creating an API using Flask, Connexion and SQLAlchemy to access a database. To do this I needed the following dependencies:
Flask-SQLAlchemy
Flask-Marshmallow
Marshmallow-SQLAlchemy
Marshmallow
When I run the file with the app instance using…

Fidelis Maina
- 55
- 1
- 11
0
votes
0 answers
Allow X-API-Key in either header or query for OpenAPI/Swagger
I am using ApiKeyAuth in OpenAPI (with Python and Connexion) and want to be able to pass the X-API-Key parameter either in the header or the query. The spec seems to suggest I can only have one or the other, not both at the same time.
This way…

Paul Watson
- 732
- 7
- 17
0
votes
0 answers
Failed to find Flask application or factory in module "run"
I'm trying to run a simple connexion REST-API. I have instantiated the instance of connexion on run.py.
import os
import connexion
from flask import render_template
from users import read
app = connexion.App(__name__,…

Govinda Malavipathirana
- 1,095
- 2
- 11
- 29
0
votes
1 answer
How to validate REST api params using regex in flask?
I am working on a REST api using flask/connexion. Consider this endpoint:
http://127.0.0.1:5000/api/library/{category_name}/{version}
category_name and version are from string type. How can I validate them with a custom regex?
I am using sqlalchemy…

hd.
- 17,596
- 46
- 115
- 165
0
votes
1 answer
aiohttp - before request for each API call
When I was using Flask, every API call is authenticated before processed:
app = connexion.App(__name__, specification_dir='./swagger/', swagger_json=True, swagger_ui=True, server='tornado')
app.app.json_encoder =…

Anant
- 153
- 14
0
votes
2 answers
Prevent Flask from double logging when running in console
I'm using Python Flask and Connexion to create a REST API. It's hard to figure out how logging is working with using these two libraries, and I've run in to a strange issue with double logging when trying to run/debug locally.
app/log.py
import…

Dan Walker
- 434
- 1
- 5
- 15
0
votes
1 answer
Can you mix Swagger's parameters in query and in body?
I am getting errors when i am trying it, but i wanted to create an endpoint which accepts 2 query params and 1 body item, a list of names. When I run it in connexion but says it is an invalid specification.
/devices/list:
post:
tags:…

Fallenreaper
- 10,222
- 12
- 66
- 129
0
votes
0 answers
Python web App Multiprocessing/Multithreading connexion[swagger-ui]
I have a Python Web App defined using connexion[swagger-ui], on my my_app.py file:
if __name__ == '__main__':
# run our standalone gevent server
application.run(server='gevent', port=8080)
Now, I have another python file, test.py that is…

gr7
- 492
- 3
- 11
0
votes
0 answers
Expose Flask (connexion) instance to uWSGI in Nginx
When running my Docker image and requesting the Swagger UI I receive: 502 Bad Gateway.
I am attempting to run Connexion (Flask-based Swagger UI generator) with uWSGI on nginx. I assume it is because uWSGI does not correctly pick up my Flask…

lammy
- 457
- 2
- 5
- 22
0
votes
1 answer
How to forbid non-browser requests (user agents) to a POST endpoint in flask app?
I'm loading a login form to conduct user verification. I was wondering if I could limit an endpoint in flask app to only respond to browser requests in which I previously loaded the form for.
I think CSRF token may be an option but I was wondering…

Meysam
- 596
- 6
- 12
0
votes
1 answer
How to handle non-required parameters in Swagger to avoid missing positional argument error?
I have a Swagger file for my endpoints, one of my endpoints has several parameters. How do you handle non-required parameters? I'm having a challenge on how to handle it on my Python file if the non-required parameters have empty value.
Here is my…

GeekyDad
- 75
- 1
- 7
0
votes
1 answer
How to fix exception in self._validate_spec(raw_spec)?
I am attempting to generate Flask code, using Connexion, from a .yaml file containing OpenAPI 3.0.0 specifications.
When I execute this:
I get
import connexion
app = connexion.App(__name__,…

midniteOverflow
- 13
- 7
0
votes
0 answers
How to include additional, unknown fields when loading data with marshmallow-mongoengine?
I am building a REST API on top of Flask and Connexion using marshmallow-mongoengine and MongoEngine to work with MongoDB.
Problem: If my input data includes additional, unknown fields they are always excluded from the resulting object when loading…

mplaine
- 15
- 4