Skip to content

Failed to load API definition - Internal Server Error doc.json #321

Open
@bt-nia

Description

@bt-nia

I'm having the exact same issue as #230
However, I do have the doc imported and gin-swagger stuff is initialized:

import (
	"context"
	"encoding/json"
	"flag"
	"fmt"
	"log"
	"net/http"
	"os"
	"strconv"
	"time"

	"golang.org/x/oauth2/google"

	admin "google.golang.org/api/admin/directory/v1"

	"github.com/gin-gonic/gin"
	"google.golang.org/api/option"

	"PRIVATE/docs"
	"PRIVATE/pkg/api"
	"PRIVATE/pkg/auth"
	"PRIVATE/pkg/storage"

	// Swaggo Swagger imports
	swaggerFiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
)
[...]
	// Swagger endpoint
	docs.SwaggerInfo.BasePath = "/api/v1"
	router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
[...]

FIles exist:
Image

The server errors with 500 upon access:
Image

What am I missing? is it because of swaggo v2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions