8

We have built APIs based on Azure function and all of the APIs are python based. I know that APIM provides a nice way of importing Azure function and creating and managing APIs. However, i am looking for a light & quick solution for developers so they can work among themselves.

Swagger is very popular in Java ecosystem and we are using in our spring boot application by just adding a few annotations.

Is there anything similar available for Azure functions written in Python. My end goal to have API documentation exposed by some endpoints so that different teams (API producers & consumers) can work efficiently without going through the confluence, etc

SunilS
  • 2,030
  • 5
  • 34
  • 62

3 Answers3

3

This is certainly possible for a C# Azure Functions app quite easily via this official extension https://github.com/Azure/azure-functions-openapi-extension

I don't think the same can be said for the Python at this time, unfortunately.

Mark Z.
  • 2,127
  • 16
  • 33
1

It is fairly simple with Azure. Since, these are functions, using swagger does not make sense and I guess it won't be possible too.

Azure has a built-in open API definition service. All you need to do is create a API Management Instance and them import the functions into it. After importing all the functions, you can go ahead and download the OpenAPI definition file. You can even choose to host it somewhere for easy access.

Here is the link to a detailed guide

Debdut Goswami
  • 1,301
  • 12
  • 28
0

I'm not certain if you can do it, but the company I work for has SwaggerHub, which allows me to generate server stubs in a number of languages including python-flask. I tried this on one of our APIs and checked the code - it's using a framework called Connexion - see here and here.

Connexion is a framework on top of Flask that automagically handles HTTP requests defined using OpenAPI

Another thing to note; looks like you can use flask framework for Azure function app as per here.

Ryan.Bartsch
  • 3,698
  • 1
  • 26
  • 52