azure-functions-openapi-extension
azure-functions-openapi-extension copied to clipboard
Feature Request: Generate swagger file when FunctionApp is compiled
It would be great to have the ability to produce swagger.json or swagger.yaml when the FunctionApp is compiled.
Issue: When we are running a pipeline (using a bicep template) to create the API operations (in Azure API Management), using the swagger URL for the FunctionApp. The swagger file is not accessible when the FunctionApp is configured with Authentication.
Workaround: One workaround would be to have an option to output the swagger.json as part of the build where the bicep template cold reference the file locally.
any thoughts??
@zapadoody Thanks for the issue. We're working on the CLI feature to sort out your request. However, in the meantime, you can still figure that out by a small trick like:
https://github.com/Azure/azure-functions-openapi-extension/blob/e432a6bcdcd6f060f8a0cc58db680066f20157cb/.github/workflows/main-build.yaml#L77-L108
It's our GitHub Actions workflow, which you might be interested in getting the OpenAPI document within your CI/CD pipeline.
And here's the blog post you might want to read.
Perfect thanks for the workaround, I'll keep an eye out for the CLI update.
@zapadoody - would you mind sharing detail on how you applied the workaround?
Would be keen to have the swagger file generated in build pipeline myself =)
As this PR, #489, has been merged, you can generate the OpenAPI doc within the GitHub Actions workflow on-the-fly.