spec-first / connexion

Connexion is a modern Python web framework that makes spec-first and api-first development easy.
https://connexion.readthedocs.io/en/latest/
Apache License 2.0
4.5k stars 765 forks source link

OpenAPI callbacks #1587

Open jayvdb opened 2 years ago

jayvdb commented 2 years ago

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:

RobbeSneyders commented 2 years ago

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.

jayvdb commented 2 years ago

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.

RobbeSneyders commented 2 years ago

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.