Skip to content
Azure function to generate a proper Swagger definition for Azure functions
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mAdcOW.AzureFunction.SwaggerDefinition
.gitattributes
.gitignore
LICENSE
README.md
mAdcOW.AzureFunction.SwaggerDefinition.sln Add project files. Aug 25, 2017
mAdcOW.AzureFunction.SwaggerDefinitionv2.sln

README.md

AzureFunction Swagger Definition Generator

Author Twitter
Mikael Svenson @mikaelsvenson

Azure function to generate a proper Swagger definition for the other Azure functions in your project.

Maybe a bit meta ;)

Notes and reflection on my part

  • The Swagger generator will only create 200 return codes. If you have other return codes you need to specify them manually.
    • As an example, you might want to return 201 (Created) if your operation creates something.
  • It's recommended to use objects as both input and output parameters, as they are most descriptive
  • It's recommended to use POST over GET for complex input, as chanses of encoding issues etc. are smaller.
  • See Templates.cs for common useful Function signatures.
  • I don't fine the default in parameter HttpRequestMessage all that useful, as generating Swagger from random input is quite hard. Better to pass in a typed request object.
You can’t perform that action at this time.