Swashbuckle.aspnetcore: Is Swashbuckle.AspNetCore.ReDoc being maintaned?

Created on 21 May 2018  Â·  14Comments  Â·  Source: domaindrivendev/Swashbuckle.AspNetCore

Hi!

I currently use Swagger and Redoc on .Net Framework, I looked at the source code of this project and realized there's already a built-in Redoc package. However I'm getting a error trying to use it, the Redoc webpage goes to infinite loading and at the browser console you can see the error: "redoc.min.js:7 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'toString' of undefined
TypeError: Cannot read property 'toString' of undefined".

I have tried looking at the documentation for details but I haven't found any regarding the Redoc package inside swashbuckle, is the development of this project currently active?

Most helpful comment

OK,

Yes https://localhost:xxxxx/api-docs works, thanks. Unfortunately once I saw ReDoc it only provides the docs, but no ability (I could see) like SwaggerUI's "Try it out" where you can exercise the ASP.NET Core's Web API controllers.

To help others who want to try ReDoc then you need to:

  1. Load the NuGet package Swashbuckle.AspNetCore.ReDoc
  2. replace the app.UseSwaggerUI(... in your ASP.NET Core Startup class with
    c# app.UseReDoc(c => { c.SpecUrl = "/swagger/v1/swagger.json"; c.DocumentTitle = "Your API name"; });
  3. Go to https://localhost:xxxxx/api-docs to see the ReDoc pages

NOTE to @domaindrivendev. I was really looking for a more compact UI, like https://github.com/jensoleg/swagger-ui, which includes "Try it out" feature. I saw your issue #377, but that looked like hard work and I hoped ReDoc would help, but it didn't.

All 14 comments

Did you find an answer?

I'm also trying to use ReDoc. I installed the package Swashbuckle.AspNetCore.ReDoc and replaced UseSwagger with UseRedoc, but I couldn't find a page to go to, i.e. localhost:xxxxx/swagger showed page not found.

Is there any documentation on how to use ReDoc?

@JonPSmith Did you point the SpecUrl after setting ReDoc as the UI to the swagger.json location?

Yes, I set SpecUrl to the same setting that SwaggerUi used, and I set the DocumentTitle to the same as SwaggerUi - see code below

            app.UseReDoc(c =>
            {
                c.SpecUrl = "/swagger/v1/swagger.json";
                c.DocumentTitle = apiTitle;
            });

I got a 404 status when I went to https://localhost:xxxxx/swagger

I believe the default RoutePrefix for ReDoc is “/api-docs” as opposed to “swagger”.

You’re correct that the docs are lacking - are you interested in submitting a PR to update them?

OK,

Yes https://localhost:xxxxx/api-docs works, thanks. Unfortunately once I saw ReDoc it only provides the docs, but no ability (I could see) like SwaggerUI's "Try it out" where you can exercise the ASP.NET Core's Web API controllers.

To help others who want to try ReDoc then you need to:

  1. Load the NuGet package Swashbuckle.AspNetCore.ReDoc
  2. replace the app.UseSwaggerUI(... in your ASP.NET Core Startup class with
    c# app.UseReDoc(c => { c.SpecUrl = "/swagger/v1/swagger.json"; c.DocumentTitle = "Your API name"; });
  3. Go to https://localhost:xxxxx/api-docs to see the ReDoc pages

NOTE to @domaindrivendev. I was really looking for a more compact UI, like https://github.com/jensoleg/swagger-ui, which includes "Try it out" feature. I saw your issue #377, but that looked like hard work and I hoped ReDoc would help, but it didn't.

@JonPSmith (or anyone else)

Did you ever manage to integrate swashbuckle with another swagger-ui theme/fork, like https://github.com/jensoleg/swagger-ui?

Hi @lonix1,

No, I gave up. Sorry.

@lonix1 are you asking if anyone has implemented the Try It Out feature seen in SwaggerUI in the swashbuckle version of ReDocUI?

No I'm asking if anyone has managed to use a different ui, like discussed above. I assume not. Also I see that those other uis have not been maintained in a while, so it might be pointless to try. swaggerui is ugly but at least it works.

Well the ReDoc UI is a different UI than swagger ui, but the functionality
of swagger try it out feature does not exist in ReDoc yet

On Sun, May 5, 2019, 3:05 AM lonix1 notifications@github.com wrote:

No I'm asking if anyone has managed to use a different ui, like discusses
above. I assume not. Also I see that those other uis have not been
maintained in a while, so it might be pointless to try. swaggerui is ugly
but at least it works.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/738#issuecomment-489397574,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACXHZREJSWNV6FNK6LSYJMDPT2BLNANCNFSM4FA5FFEQ
.

@lonix1

swaggerui is ugly but at least it works.

That was the conclusion I came to as well.

couple notes: 1 - you can make swagger and redoc both available , so you put:```
app.UseReDoc(c => {
c.SpecUrl = "/XXX/swagger/v1/swagger.json";
c.DocumentTitle = "MailBox API Doc";
});

        app.UseSwagger(c => { c.RouteTemplate = "XXX/swagger/{documentName}/swagger.json"; });
        app.UseSwaggerUI(option =>
        {
            option.SwaggerEndpoint("/XXX/swagger/v1/swagger.json", "Web Client API Documentation");

2 - i had to add injection for redoc (you can download them and load from local files as well):
app.UseSwaggerUI(option =>
{...
option.HeadContent = @"
";
...
```

        app.UseSwaggerUi3(); // serve Swagger UI
        app.UseReDoc(); // serve ReDoc UI

For other users, by default both use the /swagger route!

Was this page helpful?
0 / 5 - 0 ratings