Skip to main content

All Questions

Tagged with
1 vote
1 answer
60 views

How is maxLength/minLength translated by go-gin

I have a simple schema object SerialNumber defined as: SerialNumber: type: object description: | A serial number of an entity. This is a basic string but with length ...
2 votes
1 answer
3k views

How to detect the json in request body has null value for a key or key is not given

I'm creating a API server using Go gin framework. Now I trying to add PATCH operation for /users endpoint. PATCH operation receives partial properties in json request body and updates the properties ...
-2 votes
0 answers
18 views

Authentication header changing to smaller-cased(authentication) when sending POST request from golang server(rusty) [closed]

in the golang server when sending a POST request with a bearer Authorization , the request is being changed and at the url i hit from the golang it is shown as authorization. where the 'a' hash been ...
0 votes
1 answer
26 views

Accessing internal model info while using go-gin and openapi [closed]

I am using swagger/openapi to write a simple REST interface. In openapi I specify that some parameters are "required". For, example, the /api/v1/device is a REST endpoint. The Device object ...
1 vote
0 answers
36 views

How to Set Up Hot Reload for Gin Application Using Docker and Air in Dev Environment?

I'm working on a backend system using Gin and Docker, and I'm trying to set up two different environments: development and production. In the development environment, I want to use Air for hot ...
1 vote
0 answers
27 views

Go/Gin dlv debugger doesn't work with docker and vscode

I try to setup dev environment for Gin framework using docker and vscode. I can't figure why the breakpoint is visible in the debug console but seems the breakpoint has no effect. In docker I'm ...
2 votes
1 answer
21 views

gin router 404 on url patterns with :id parameter

I am getting a 404 error from a URL pattern with a quite simple parameter in it. I am using gin-gonic with golang. Here is my main programme. I've removed all other routing to isolate the problem. ...
0 votes
1 answer
58 views

Parsing path parameters dynamically from request url

I am working on a project using the fiber/v2 router, for a request mocking service. Now parameters passed via request body and query parameters are not an issue and handled easily. But here lies the ...
-2 votes
0 answers
30 views

Golang test cases for gin failing [closed]

Hi All I am trying to create a test cases for my gin gonic framework where I am using Gorm and ORM but I am getting errors like this: [31m2024/07/03 08:48:19 [Recovery] 2024/07/03 - 08:48:19 panic ...
2 votes
1 answer
240 views

CodeQL: Gin / MongoDB API - Database query built from user-controlled sources error

I have a simple Golang Gin API that uses MongoDB as the backend database. My team is using GitHub CodeQL, so we want to be sure we are following the best standards. However, we continue to get this ...
-1 votes
1 answer
44 views

Cannot use exported method that belongs to the package in Golang

I've got a package named services. This is the structure of the package: services/ third_party/ discogs.go discogsAPIStructs.go artist_srv.go auth_srv.go record_srv.go ...
15 votes
2 answers
34k views

How to render static files within Gin router?

I want to serve a JSON file with gin server. And set some customize values in the HTML file. Use JavaScript in it to call the JSON file. My application structure: . ├── main.go └── templates ├── ...
1 vote
0 answers
12 views

HTMLGlob template pattern matching with nested subdirectories

I am working on a golang project using gin and go templating. My templates are in a structure like so: C:. ├───components ├───display .... I would like to add subdirectories to organise the templates,...
1 vote
1 answer
62 views

Problem with Sending Data through Channel with Gin Context

I create a timeout middleware and I keep getting a warning that says 'Headers were already written. Wanted to override status code 504 with 500' whenever it times out. I want to avoid that warning by ...
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 ...

15 30 50 per page
1
2 3 4 5
61