mvrilo / go-redoc

go-redoc is an embedded OpenAPI/Swagger documentation ui for Go using ReDoc
MIT License
66 stars 28 forks source link

gin response code 404 #14

Open ChnMig opened 3 months ago

ChnMig commented 3 months ago

This is my test demo.

package main

import (
    "github.com/gin-gonic/gin"
    "github.com/mvrilo/go-redoc"
    ginredoc "github.com/mvrilo/go-redoc/gin"
)

func main() {
    doc := redoc.Redoc{
        Title:       "Example API",
        Description: "Example API Description",
        SpecFile:    "./openapi.yml",
        SpecPath:    "/openapi.yml",
        DocsPath:    "/docs",
    }

    r := gin.New()
    r.Use(ginredoc.New(doc))

    println("Documentation served at http://127.0.0.1:8000/docs")
    panic(r.Run(":8000"))
}

When I run and visit http://172.28.73.58:8000/docs Page stuck in initialization (172.28.73.58 is my wsl2 ip) image image And my gin run window has a warning message [GIN-debug] [WARNING] Headers were already written. Wanted to override status code 404 with 200 Can you tell me how to solve it? thank

anand-panigrahi commented 2 months ago

facing same issue ? Any solution for this ?

anand-panigrahi commented 2 months ago

working fine with tag v0.13 :)

hiranivipul commented 2 months ago

@ChnMig Working fine in 0.1.3

mvrilo commented 2 months ago

Hey everyone, sorry the delay here. It seems that this issue was already fixed on master, it's just missing a new release - my bad. I've just pushed a new tag, it should work fine now with v0.1.5. Thanks for the report and help @ChnMig @lemonScaletech @hiranivipul