Generating swagger for azure functions until its available OOB

Please follow the steps below to generate swagger for Azure functions

  1. Get a fiddler/postman session working with your function so that you have the json ouput.
  2. Past the Json as class using the following in Visual Studiopastedimage
  3. Create a webapi application, configure swagger (the howto can be found here create a controller method with the necessary input and output values (no method implementation is necessary except for returning expected output)
            // GET api/values/5
    public List<Rootobject> Get()
    return new List<Rootobject>();}
  4. Then just navigate to  http://yourapplication:portno/swagger  to make sure all the datatypes for your particular operation are shown accordingly.
  5. Then download the swagger file from http://yourapplication:portno/swagger/docs/v1  and save it to a file
  6. Then navigate to open the saved file (copy paste also works) and  add or remove what you need….

Hopefully this will help in saving some time…