Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wobba/AzureFunction-SwaggerDefinition
Azure function to generate a proper Swagger definition for Azure functions
https://github.com/wobba/AzureFunction-SwaggerDefinition
Last synced: 3 months ago
JSON representation
Azure function to generate a proper Swagger definition for Azure functions
- Host: GitHub
- URL: https://github.com/wobba/AzureFunction-SwaggerDefinition
- Owner: wobba
- License: unlicense
- Created: 2017-08-25T13:30:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-12T10:22:48.000Z (about 6 years ago)
- Last Synced: 2024-07-20T02:29:57.688Z (4 months ago)
- Language: C#
- Size: 24.4 KB
- Stars: 32
- Watchers: 7
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-functions - SwaggerDefinition - Azure function to generate a proper Swagger definition for Azure functions. (Cloud Functions)
README
# AzureFunction Swagger Definition Generator
| Author | Twitter
--- | ---
| Mikael Svenson | @mikaelsvensonAzure 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.