gin icon indicating copy to clipboard operation
gin copied to clipboard

ShouldBindQuery does not work properly

Open KoNekoD opened this issue 1 year ago • 3 comments

  • With issues:
    • It can't parse /api/characters?filter[name]=Shrek

Description


type CharactersFilter struct {
	Name *string `json:"name" form:"name"`
}

type SearchDTO[Filter any] struct {
	Pagination *PaginationDto `json:"pagination"`
	Filter     *Filter        `json:"filter"`
}

How to reproduce

Send request to /api/characters?filter[name]=Shrek

KoNekoD avatar Nov 25 '24 12:11 KoNekoD

I am familiar with the previous discussions, I intend to add the ability to parse nested Query Strings

KoNekoD avatar Nov 25 '24 12:11 KoNekoD

I am familiar with the previous discussions, I intend to add the ability to parse nested Query Strings

You can try changing the request /api/characters?filter[name]=Shrek -> /api/characters?name=Shrek

Madou-Shinni avatar Mar 06 '25 07:03 Madou-Shinni

@Madou-Shinni Look at this https://github.com/KoNekoD/go-querymap. I already done it :)

KoNekoD avatar Mar 09 '25 08:03 KoNekoD