Questions tagged [connexion]

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.

151 questions
2
votes
1 answer

Is there a particular syntax for using python relative imports alongside connexion?

I am currently trying to build an api using connexion. However, I am having some issues using relative local module imports through the connexion module, which modifies the underlying flask app. Here is a simplified overview of my file…
Henry Bowe
  • 21
  • 1
2
votes
1 answer

Which logger to use in a Python Flask app with Connexion

I'm using both Flask and Connexion for a Python based REST API, and it runs within a Docker container. Here is main.py: import connexion import logging from app.log import handler # initiate swagger/connexion application = connexion.App(__name__,…
Dan Walker
  • 434
  • 1
  • 5
  • 15
2
votes
1 answer

How to specify the function used to validate the Basic auth with Flask-connexion and swagger-2.0 API

I'am using swagger 2.0 API with Flask-connexion. In the swagger.yml file, I set the security definition to basic: BasicAuth: type: basic And then, I added this security to the path I want to secure. # Tenant paths /tenant: get: …
2
votes
1 answer

Error while linking yaml files in connexion

I'm working on custom microservice which will be doing sort of authentication for a web service. Microservice is under development using flask, swagger and connexion. Since swagger.yaml file getting huge(due to load of urls) to reduces the…
Govinda Malavipathirana
  • 1,095
  • 2
  • 11
  • 29
2
votes
3 answers

How to handle FlaskInjector error at start at python flask api app?

I set up a most basic structure of an API in python wit the stack flask - connexion - flaskInjector according to the code shown below. When the API is run and FlaskInjector is initialized, it fails with the error message: injector.CallError: Call…
noteven2degrees
  • 383
  • 2
  • 9
2
votes
0 answers

Routing fails with multiple server URLs

I have deployed a web service using Connexion and OpenAPI 3.0. I run it locally for debugging testing, and deploy it to a production server subsequently. I am struggling with how to specify the server URLs properly in the OpenAPI file. All works as…
Carsten
  • 1,912
  • 1
  • 28
  • 55
2
votes
1 answer

ModuleNotFoundError in Connexion

I have an OpenAPI 3.0 specification and I want to use it with Connexion to run a Python service. The relevant part of the API specification is here: paths: /find: post: summary: XXX description: XXX operationId:…
Carsten
  • 1,912
  • 1
  • 28
  • 55
2
votes
1 answer

How do I log swagger / connexion request body?

I'm using connexion and Swagger to create an API in Python. I'd like to log all of the incoming calls to a file so I can see what's being requested. I've been able to log the path of the calls I've received but I can't figure out how to log the…
Ben
  • 4,798
  • 3
  • 21
  • 35
2
votes
2 answers

Error in python microservices with connexion+Flask+Swagger

I'm trying to make a microservice with python, I'm following this tutorial But I'm getting this error: "flask_app.py", line 115, in run raise Exception('Server {} not recognized'.format(self.server)) Exception: Server 9090 not…
2
votes
1 answer

Swagger-ui connexion not finding Python nested functions

I'm trying to document an already existing python API with Swagger. I wrote the swagger.yaml with every route documented with the help of their editor. Now i would like to deploy the documentation using connexion. (brief example of the swagger.yaml…
2
votes
0 answers

How to return file contents from controller?

I'm trying to return the contents of an image file via a Python Connexion application generated from an OpenAPI v2 spec file using swagger-codegen and the python-flask language setting. In my controller module, I simply do the following: def…
ScoPi
  • 1,193
  • 9
  • 14
2
votes
1 answer

Error generating Swagger server (Python Flask) from Swagger editor

I've used the Swagger Editor to manually generate my Swagger spec file and generated the files for a Python Flask server. Following the README I installed connexion, but when I run python app.py I get the error: ValueError: need more than 1 value…
tw1742
  • 1,424
  • 4
  • 18
  • 37
1
vote
1 answer

Different error handling for different endpoints

I have error handlers in my app. I add these using connexion's add_error_handler which is calling flask's register_error_handler. I wish to restructure the error data that is returned by my endpoints in this handler. However, since I have so many…
Baz
  • 12,713
  • 38
  • 145
  • 268
1
vote
0 answers

module 'django.http.request' has no attribute 'session'

I created a class to generate a token when the user logs in. I would like to create a session when the user logs in. Here is the error I am getting: "module 'django.http.request' has no attribute 'session'" Thank you for helping me. Voici l'extrait…
1
vote
1 answer

Websockets alongside a python http server

I'm trying to figure out the best architecture to support connections to thousands of websockets alongside a managing HTTP server. I want to be able to manage all of the connections through the HTTP server with minimum complexity. Ideally, I am…
1 2
3
9 10