We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When trying to parse a form data to map, I'm getting an error schema: interface must be a pointer to struct
schema: interface must be a pointer to struct
https://youtu.be/XnhXTXW8JmM
package main import ( "bytes" "errors" "net/url" "reflect" "github.com/gofiber/fiber/v2" ) func main() { app := fiber.New() app.Post("/", func(ctx *fiber.Ctx) error { var data map[string]any err := ctx.BodyParser(&data) if err != nil { return err } return ctx.JSON(data) }) app.Listen(":8081") }
curl -X POST http://localhost:8081 \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "method=GET&path=/user/:id&handlerMsg=User Profile"
It should have worked with map, struct or slice
v2.52.5
The text was updated successfully, but these errors were encountered:
var data map[string]any
Maybe you have change var data map[string]any to var data map[string]interface{}
var data map[string]interface{}
Sorry, something went wrong.
@klikpaspor It's same for both
No branches or pull requests
Bug Description
When trying to parse a form data to map, I'm getting an error
schema: interface must be a pointer to struct
https://youtu.be/XnhXTXW8JmM
How to Reproduce
Expected Behavior
It should have worked with map, struct or slice
Fiber Version
v2.52.5
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: