connexion icon indicating copy to clipboard operation
connexion copied to clipboard

OpenAPI callbacks

Open jayvdb opened this issue 3 years ago • 3 comments

Description

OpenAPI callbacks define outgoing async requests, typically back to the sender. Also known as webhooks. docs: https://swagger.io/docs/specification/callbacks/ spec: https://spec.openapis.org/oas/v3.0.2#callbackObject

It appears they are not supported yet.

Expected behaviour

For the mocking, https://blog.stoplight.io/mocking-callbacks-openapi-prism shows how these callbacks are utilised by https://github.com/stoplightio/prism to create mocks.

Additional info:

Output of the commands:

  • python --version Python 3.10.6

  • pip show connexion | grep "^Version\:" Version: 2.14.1

jayvdb avatar Sep 13 '22 07:09 jayvdb

Hi @jayvdb,

Could you please clarify which behavior you're expecting from connexion? It's not clear to me what you mean by supporting callbacks.

RobbeSneyders avatar Sep 13 '22 09:09 RobbeSneyders

Hiya, most relevant to my need is connexion being able to generate mocks that initiate the callback that are defined in the spec. So far the only tool which I can find which does this is prism, which is node based, and I would really prefer a tool in almost any other language for this job.

jayvdb avatar Sep 13 '22 10:09 jayvdb

Alright, so this is purely about the mocking behavior? I guess that could be useful.

It's not very high on our priority list though, so feel free to work on this yourself and submit a PR. You probably want to look here: https://github.com/spec-first/connexion/blob/3e52c782ebd15b35ab13ee15b80603c2ad8279ac/connexion/mock.py#L50-L54

Please confirm if you're interested to pick this up yourself, otherwise I'll close this issue.

RobbeSneyders avatar Sep 13 '22 16:09 RobbeSneyders