简体   繁体   English

如何在我的 webApi 中更改 Swagger 的徽标

[英]How can i change the logo of Swagger in my webApi

我正在使用 Swashbuckle 添加我的 WebAPI 2 的文档,我需要更改 Swagger 的徽标和标题的颜色,但我不知道如何执行此操作.. 任何帮助将不胜感激!

you can change logo and header color with css : find style.css or main css file in your swagger third app for example in drf-yasg you can fine drf root path style.css file add these lines to css :您可以使用 css 更改徽标和标题颜色:在您的第三个应用程序中查找 style.css 或主 css 文件,例如在 drf-yasg 中,您可以将这些行添加到 css 中:

/* Custom CSS  */

.topbar-wrapper img {
    content: url(http://127.0.0.1:8000/static/company/logo.png);
}

.swagger-ui .topbar .download-url-wrapper .download-url-button {
    background-color: #red !important;
}

.swagger-ui .topbar .download-url-wrapper input[type=text] {
    border-color: #red !important;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何用我已有的 openapi 更改 swagger.json 文件 - How can change swagger.json file with my openapi which I already have 我如何允许空值被我的WebAPI模型接受? - How can I allow nulls to be accepted by my WebAPI model? 如何更改几个共享站点或所有共享站点上的站点徽标的URL? - How do i change url of site logo on sevral sharepoint sites or All my sharepoint sites? 如何在任务栏中隐藏Windows 7徽标? - How can I hide the Windows 7 logo in the taskbar? 如何合并WebAPI控制器中的所有“设置代码”? - How can I consolidate all of my “setup code” away from my WebAPI controllers? 如何更改Swagger响应的类型? - How do I change the type of a Swagger response? 如何在 WebAPI 中使用 Swagger 作为 IAppBuilder 的欢迎页面 - How to use Swagger as Welcome Page of IAppBuilder in WebAPI 如何更改ASP WebAPI 2返回的OAuth令牌的Json大小写格式? - How can I change the Json casing format of the OAuth token returned by ASP WebAPI 2? 如何从前端(Angular)向C#.net datetime(webAPI)发送日期? - How can I send a date from my front end (Angular) to C# .net datetime (webAPI)? 如何通过现有的WebAPI验证我的MVC5应用程序? - How can I authenticate my MVC5 application through an existing WebAPI?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM