Comments (9)
In this version, you customize the swagger-ui by providing a custom version of index.html. The easiest way to do this is by creating a copy at wwwroot/swagger/ui/index.html. If you need dynamic rendering, you can alternatively create a controller and view for the route - "swagger/ui/index.html". There's a sample under test/WebSites that you can use for reference.
from swashbuckle.aspnetcore.
You can place additional assets (CSS, JavaScript etc) in the wwwroot folder too and simply reference them in your customized index.html
from swashbuckle.aspnetcore.
I had originally intended scrapping the C# interface for customizing the embedded swagger-ui. The thinking being that a custom version of "index.html" (easily injected via wwwroot) would be the preferred approach anyway. However, it seems a lot of people like the additional layer of abstraction and feel the custom index.html approach is too brittle.
So, I'm considering adding this feature back in. But, it won't be for a couple of iterations - certainly not before beta3.
from swashbuckle.aspnetcore.
Was this feature added back in? I would love to have a way to customize the UI without having to copy-paste the entire index.html contents.
from swashbuckle.aspnetcore.
I hope to add it back in the next milestone - beta10. PR's always welcome :)
@andyalm - are you writing your Angular back-ends in Rails? If so, you might want to check this out - https://github.com/domaindrivendev/swagger_rails.
from swashbuckle.aspnetcore.
I've created a PR for this. Please see #166
from swashbuckle.aspnetcore.
Is there a way to do this yet? I can get this working by putting an index.html and its css into my wwwroot directory of my api, but I was hoping there was a way to do this in code.
from swashbuckle.aspnetcore.
Available with latest pre-release. Note the package rename to "Swashbuckle.AspNetCore.1.0.0-rc1"
from swashbuckle.aspnetcore.
It looks like the method was removed again. I just finished adding it in my fork, and will submit a new issue and pull request (since I can't re-open this bug.)
from swashbuckle.aspnetcore.
Related Issues (20)
- [Bug]: ApiKey security scheme with Header location dont work HOT 2
- [Feature request]: FlattenInheritanceHierarchy support in AspNetCore
- [Question]: Ensuring the Correct Order of Operation and Schema Filters in Swashbuckle.AspNetCore HOT 4
- [Feature request]: Document specific SwaggerGenOptions
- [Bug]: File upload using [FromForm] IFormFile file throws an error HOT 1
- [Bug]: Using SetCurrentDirectory in combination with AfterTargets does not work while publishing HOT 5
- [Bug]: Swashbuckle.AspNetCore.Cli v.6.7.0 doesn't generate format of the property HOT 4
- [Bug]: Inconsistent examples/schemas generated for types HOT 1
- [Feature request]: Replace usage of IdentityServer4 in tests
- [Bug]: Multi-line paragraphs render as pre code html tag pair
- [Bug]: A nullable struct property results in an invalid generated schema. HOT 5
- [Bug]: String in json format as input for [FromForm] is not recognized in UI HOT 4
- [Bug]: In the `Apply` method of the `IOperationFilter` interface, all schemas in `operation.RequestBody.Content` are either `null` or have a `Count` of `0`. HOT 2
- [Bug]: The annotation of the field parameter using FromForm in the interface is not displayed HOT 21
- [Feature request]: EditorConfig HOT 8
- [Bug]: SchemaFilter return properties count zero for subclasses HOT 11
- [Bug]: Nullability problems with dictionaries
- Missing Authorization Header in Swagger UI After Upgrading Swashbuckle.AspNetCore from 6.5.0 to 6.6.1 HOT 4
- [Bug]: IFormFile & FromForm swagger UI generates bad request HOT 1
- Scope checkbox no longer added after upgrade HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swashbuckle.aspnetcore.