Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.1.4 - v2.2.0-beta2 请求结构体 中无法使用 *gjson.Json 来接受参数 #2172

Closed
glennliao opened this issue Oct 8, 2022 · 0 comments
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version.

Comments

@glennliao
Copy link
Contributor

1. What version of Go and system type/arch are you using?

go 1.19, win/amd64

2. What version of GoFrame are you using?

v2.1.4 - v2.2.0-beta2

3. Can this issue be re-produced with the latest release?

Y

4. What did you do?

type DemoReq struct {
	g.Meta `path:"/demo" method:"post"`
	Data   *gjson.Json
}

type DemoRes struct {
}

type Api struct{}

func (a *Api) Demo(ctx context.Context, req *DemoReq) (res *DemoRes, err error) {
	g.Dump(req)
	return nil, err
}

var api = Api{}

func main() {
	s := g.Server()
	s.Group("/", func(group *ghttp.RouterGroup) {
		group.Bind(api)
	})
	s.Run()
}

5. What did you expect to see?

可接收请求体为

{
    "data":{
        "asd":1
    }
}

的json请求

6. What did you see instead?

b41699f6dcf939d04205f29c8390072

gqcn added a commit that referenced this issue Oct 8, 2022
@gqcn gqcn added bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version. labels Oct 8, 2022
@gqcn gqcn closed this as completed Oct 8, 2022
gqcn added a commit that referenced this issue Oct 8, 2022
* version updates

* fix issue #2172
gqcn added a commit that referenced this issue Oct 8, 2022
* version updates

* fix issue #2172

* improve port listening for ghttp.Server

* UT cases update

* UT cases update

* add GetListenedPort/GetListenedAddress for gtcp.Server

* UT cases update for package gudp

* up
houseme added a commit to houseme/gf that referenced this issue Oct 13, 2022
* master: (29 commits)
  fix issue gogf#1946 (gogf#2194)
  fix issue of OmitEmptyWhere in Builder for package gdb (gogf#2195)
  fix: modify `Polaris` config readme.md (gogf#2186)
  fix info content when listens on port :0 for ghttp.Server (gogf#2191)
  fix: pgsql driver check local type error (gogf#2192)
  new version v2.2.0 (gogf#2185)
  feat: temporarily disable the unit testing of the Polaris configuration center (gogf#2183)
  package comments and readme update (gogf#2182)
  feat: create polaris config (gogf#2170)
  add function `ZipPathContent` for package `gcompress` (gogf#2179)
  feat: improve glog for polaris  register (gogf#2178)
  improve port listening for ghttp.Server (gogf#2175)
  add WithUUID for package gtrace (gogf#2176)
  fix issue gogf#1965 (gogf#2177)
  fix issue gogf#1965 (gogf#2174)
  fix issue gogf#2172 (gogf#2173)
  add `gcfg.Adapter` implements using apollo service (gogf#2165)
  add watch feature for package kubecm (gogf#2164)
  fix configuration management for package gdb (gogf#2163)
  add local db configuration support for package gdb (gogf#2161)
  ...

# Conflicts:
#	contrib/config/apollo/README.MD
#	contrib/config/apollo/apollo.go
#	contrib/config/kubecm/README.MD
#	contrib/config/kubecm/kubecm.go
#	contrib/drivers/README.MD
#	contrib/registry/polaris/go.mod
#	contrib/registry/polaris/go.sum
#	database/gdb/gdb_driver_wrapper_db.go
#	example/go.mod
#	example/go.sum
#	version.go
houseme pushed a commit that referenced this issue Oct 22, 2022
* version updates

* fix issue #2172
houseme pushed a commit that referenced this issue Oct 22, 2022
* version updates

* fix issue #2172

* improve port listening for ghttp.Server

* UT cases update

* UT cases update

* add GetListenedPort/GetListenedAddress for gtcp.Server

* UT cases update for package gudp

* up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version.
Projects
None yet
Development

No branches or pull requests

2 participants