问题描述
根据文档(
这是我下面需要在 startup.cs 文件中配置的代码.
在上面的代码中,我们需要了解的是,我们要注入两个js文件,一个是自定义js,另一个是插件,所以它会添加到Swagger UI索引页面的head部分.
这是我在 Custom.js 中的以下代码
就是这样.现在您可以下载 PDF 格式的 API 文档了.
希望这将有助于某人集成相同类型的功能.
In according to the documentation (http://swagger.io/open-source-integrations/) there are plugins for Java to Export Swagger documentation to PDF, I just have a look the documentation but I can't see anything regarding .NET.
My question is: is there something similar to the Java Plugin swagger2markup, swagger2markup-gradle-plugin in .NET or another way to export the PDF Documentation from WEB API?
thanks
I have implemented the same thing in my ongoing project. We can download PDF document of all the API's. I have done using Rapi-Pdf plugin through which we can generate PDF of swagger Json. Its in Dotnet core 2.1.
Here is my below code which we need to configure in startup.cs file.
In the above code what we need to understand is, we have to inject two js files one is custom js and another is plugin so it will added in head section of Swagger UI index page.
this is my below code which is inside Custom.js
That's it. Now you can download your API document in PDF format.
Hope this will help someone to integrate the same kind of functionality.
这篇关于Web API Swagger 文档导出为 PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!