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

Connexion create object instance

I am working on refactoring a flask app which uses connexion package for the RESTful API. Previously the code base was function based and I`m refactoring it with some OOP design principles. app = connexion.App(__name__) app.add_api( …
Razvan
  • 143
  • 8
1
vote
1 answer

How do I specify x-apikeyInfoFunc in swager securityDefinitions?

I have openapi that defines API with this securityDefinitions: securityDefinitions: APIKeyHeader: type: apiKey in: header name: Authorization security: - APIKeyHeader: [] When I start the project I get this warning: WARNING …
vqdym
  • 39
  • 6
1
vote
0 answers

How do I fix a TypeError: Object of type bytes is not JSON serializable that is only manifesting inside Docker container?

I am trying to use connexion/Flask to return a base64-encoded image generated by PIL/pillow in a HTTP Response. Having upgraded to python3.7 from python2.7, that part of the code works unaltered. However, when running inside Docker (python3.7-slim),…
jtlz2
  • 7,700
  • 9
  • 64
  • 114
1
vote
0 answers

I am facing issue on rest api call - Property read-only

I am facing an issue of HTTP response body: { detail:"Property is read-only - id" .....} on making a patch rest call on test cases. On researching I came to know about connexion dependency which may be one of the the issue. so I change the value in…
1
vote
1 answer

How to initialize RabbitMQ consumer using pika and connexion

I'm trying to set up a Python microservice that receives messages through RabbitMQ, while having a /health REST endpoint for the Kubernetes healthcheck. I'm using pika for the RabbitMQ consumer, and connexion for the REST endpoint. However, when I…
Pedro Guerra
  • 197
  • 1
  • 9
1
vote
0 answers

A flask/gunicorn service runs fine on physical machine but loose connection in docker even if timeout is set

I have a REST service written with connexion (a Flask based framework) that I run with gunicorn. The service performs heavy SQL queries to a db and dumps the result in another db. The SQL queries are done in separate threads. When I run my gunicorn…
dada
  • 1,390
  • 2
  • 17
  • 40
1
vote
0 answers

Service inside container not receiving requests

I am running a container with : docker run --env-file .env -p 0.0.0.0:8080:8080 The service inside the container is a python flask service, built with the library connexion, and listening on 0.0.0.0:8080. When I docker ls, the column…
dada
  • 1,390
  • 2
  • 17
  • 40
1
vote
0 answers

OpenAPI generates code that doesn't pass its own tests

I am trying to use the OpenAPI generator to build a testing mock that simulates an existing service, so I don't have a lot of latitude in terms of changing the schema. I've boiled down the schema to the following which highlights my issue: openapi:…
spierepf
  • 2,774
  • 2
  • 30
  • 52
1
vote
1 answer

How to change "scopes" with Auth2.0 (Connexion, Swagger)

I am tying to understand this authentication-example with OAuth2.0 and am stuck at the scopes part: https://github.com/zalando/connexion/tree/master/examples/swagger2/oauth2 In app.yaml, we define 'uid' to be the necessary scope for our…
Nin4ikP
  • 135
  • 1
  • 13
1
vote
0 answers

Connexion view function is throwing 500 error instead of catching the exception

So, I have the following view function in connexion (I am trying to work on a Open APIV3 project): def my_view_func_in_python(): return_dict = {"status": False, "stdout": None, "stderr": None} try: payload =…
raghavsikaria
  • 867
  • 17
  • 30
1
vote
3 answers

How does Connexion set the response content type?

Below is an API *.yml section. I want to set the response header for the data to be Content-type: text/plain, but it always returns application/json now. /order: post: tags: - order summary: order operationId:…
Song
  • 593
  • 9
  • 21
1
vote
0 answers

Problem authentification bearer with react native

The connexion is working but when i tried to get information from my DB with the middleware on, i have an error 401. For information, the request works on postman but not on my app. I think the problem comes from the authentification bearer in my…
Wendy Montagnon
  • 155
  • 1
  • 10
1
vote
0 answers

Problem with authorization through connexion

I am trying to login using swagger-ui and connexion. To do this, I go through the login, get a token. I substitute this token in the header. I'm authorizing (it seems like it was successful as say swagger-ui), but when I try to make a request, I get…
1
vote
1 answer

flask connexion add_api gives error: AttributeError: module 'agreement_api.controllers.agreement_controller' has no attribute 'read_agreements'

I am playing around with flask and connexion to set-up a REST API access for my application. Scenario #1: If I launch my app through Pycharm run/debug tool Everything works fine (flask app runs including the API from my…
Abdullah
  • 93
  • 14
1
vote
1 answer

Header parameters describing an API with Swagger

I'm trying to use Swagger to create the spec for a Connexion API (Python+Flask). Great tools. I know that HTTP Request Headers** are not passed to the handler functions as regular parameters but I need to be able to get request headers from the…
Angel
  • 940
  • 1
  • 9
  • 21