azure-functions-openapi-extension icon indicating copy to clipboard operation
azure-functions-openapi-extension copied to clipboard

Auto-generate swagger.json

Open jvmlet opened this issue 4 years ago • 5 comments

Would you please provide the sample of how to auto-generate swagger.json during build to use it for clients/dtos bindings generation for different languages later. I see Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI project that looks like doing exactly this, but it's not published as nuget package. Thanks

jvmlet avatar Jan 05 '22 09:01 jvmlet

I second that request, as we need the static file to be present for NSwag to generate our clients during CI/CD.

wis3guy avatar Jan 13 '22 11:01 wis3guy

@wis3guy I bypass this limitation by running the function locally (during CI build) with docker compose and azurite container. Then I provide http://myapp/api/swagger.json to NSwag.

jvmlet avatar Jan 13 '22 16:01 jvmlet

This sound very similar to #58

StefanSchoof avatar Feb 03 '22 11:02 StefanSchoof

@jvmlet Thanks for the issue! Yes, we're aware of that, but it's de-priotised over other issues. Let's keep this open for further discussion.

justinyoo avatar Feb 14 '22 03:02 justinyoo

Related: #343

justinyoo avatar Feb 14 '22 03:02 justinyoo

As the PR, #489, has been merged, you can generate the OpenAPI doc on-the-fly, within the GitHub Actions workflow.

justinyoo avatar Sep 20 '22 07:09 justinyoo