Giter Site home page Giter Site logo

Comments (9)

domaindrivendev avatar domaindrivendev commented on September 28, 2024

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.

domaindrivendev avatar domaindrivendev commented on September 28, 2024

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.

domaindrivendev avatar domaindrivendev commented on September 28, 2024

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.

andyalm avatar andyalm commented on September 28, 2024

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.

domaindrivendev avatar domaindrivendev commented on September 28, 2024

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.

andyalm avatar andyalm commented on September 28, 2024

I've created a PR for this. Please see #166

from swashbuckle.aspnetcore.

ThinkAboutGitHub avatar ThinkAboutGitHub commented on September 28, 2024

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.

domaindrivendev avatar domaindrivendev commented on September 28, 2024

Available with latest pre-release. Note the package rename to "Swashbuckle.AspNetCore.1.0.0-rc1"

from swashbuckle.aspnetcore.

jcoutch avatar jcoutch commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.