Skip to main content

All Questions

Tagged with
0 votes
1 answer
632 views

Swagger/OpenAPI documentation for file upload endpoint with metadata

I have a POST endpoint in Golang Gin that allows users to upload a file and a json object as metadata that I will store. I also use https://github.com/swaggo/swag to generate swagger/OpenApi ...
AVarf's user avatar
  • 4,981
-1 votes
1 answer
3k views

zsh: command not found: swag [closed]

I'm struggling with gin-swagger to set OpenAPI documentation on several APIs written in gin. While I installed the package in the project route via go install github.com/swaggo/swag/cmd/swag@latest I ...
Benyamin Jafari's user avatar
2 votes
0 answers
335 views

Default Param value for Gin-Swagger

I am using gin-swagger to prepare an OpenAPI for my Go project. I have a gorm struct that includes a time.Time parameter called Published. type Book struct { gorm.Model `swaggerignore:"true&...
مح��د جعفر نعمة's user avatar
1 vote
0 answers
26 views

GoSwagger wrong color for @Failure routes

I put the following description at the top of my function however the failure routes are displayed in green just as the success one in my browser: . // Register godoc // @Schemes // @Description ...
Kaido's user avatar
  • 11
2 votes
1 answer
2k views

Swag init generates nothing but "general API information"

Issue Description Swaggo fails to recursively parse Swagger comments in Go files when using the swag init command with multiple directories and the --parseDependency and --parseInternal flags. Only ...
dogbullet's user avatar
2 votes
2 answers
3k views

swag init gin. Paths is empty

I'm trying to generate swagger.json by using swag init. Here my code: package main import ( _ "album/docs" "context" "fmt" "net/http" &...
anton's user avatar
  • 31
7 votes
2 answers
9k views

Generate OpenAPI spec from gin project

Is there a way to generate OpenAPI spec files from a gin project? This issue is really hard to search for, all I could find so far are on doing there reverse.
Philippe's user avatar
  • 1,897
0 votes
2 answers
1k views

How to configure swagger UI so it doesn't need the URL?

I am using http://github.com/swaggo/gin-swagger to auto-generate the swagger and also create the UI as below. Everything works fine when I am running the server on my machine but when I run the server ...
AVarf's user avatar
  • 4,981
1 vote
1 answer
1k views

gin-swagger can not find schema type: "handler.component"

I am trying to use a struct that I created and I use in my code as the parameter, but after running swag init I am getting the following error: ParseComment error in file /src/handler/handler.go :can ...
AVarf's user avatar
  • 4,981
1 vote
3 answers
4k views

Generate Swagger documentation server in Go from Swagger/OpenAPI specification

I have an OpenAPI specification and I have used openapi-generator to generate Golang gin server. What is the conventional way to generate Swagger documentation server from the OpenAPI specification? I ...
resultsway's user avatar
  • 12.9k
3 votes
3 answers
4k views

Swagger UI still showing the example

I want to use Swagger for my RESTFul API Documentation from Go and Gin. I have this code in main.go: package main import ( "gowebservice/config" "gowebservice/controllers" ...
David Winalda's user avatar
0 votes
1 answer
2k views

How to download files using Swag golang library?

I am trying to make a REST API using gin-gonic in golang, which takes some path parameters from a GET request & downloads that file. That works correctly by curl command. However, when I add ...
user avatar
3 votes
1 answer
1k views

go-swagger: no spec available to unmarshal

I am trying to define a swagger operation for my REST endpoint written in Golang. I need to specify the POST request body and responses. // swagger:operation POST /user user createUser // // Creates ...
Arjun K S's user avatar
2 votes
3 answers
7k views

Installing swaggo on windows (swagger + gin)

I am trying to setup swagger for gin-gonic on windows. Documentation of swaggo states that I should run: go get -u github.com/swaggo/swag/cmd/swag After installation I should be able to run swag ...
Bob Meijwaard's user avatar
2 votes
1 answer
3k views

How to create swagger.json in go gin-gonic

I am trying to add documentation to my golang project which has been created using gin-gonic. The problem I am facing currently is that gin-gonic's stable version does not support swagger. Issue in ...
Akamad007's user avatar
  • 1,591