-
Notifications
You must be signed in to change notification settings - Fork 5
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
The JSON parse drops the description but not title #1
Comments
Hello! That's kind of weird, I'll try to reproduce this issue. I'd also like to mention that this repo and the guide associated to it were made using the first version of Fiber. I'd recommend switching to Fiber v2 as it brings lots of improvements to the framework. |
Hi! command-line-arguments./server.go:36:10: cannot use controllers.GetAllTodos (type func(*fiber.Ctx)) as type func(*fiber.Ctx) error in argument to app.Get Notice I have added some comments to the files, so the original line numbers do not apply. |
Hi! I think I find the breaking change in fiber v2: |
Hi! |
I added the error return type and changed the return like this: |
I've changed the func CreateTodo()
and my JSON POST |
Hi, Now I finally found the problem. I just was blind. I didn't notice my typo error in the sending JSON POST descrition key, I had there one semicolon too much. |
glad it got fixed :) i should probably make another tutorial for fiberv2 |
Hi! Thanks for a nice example of a full stack in Go!
But with this example code I have an issue. When sending JSON POST {"title":"some title","description":"some description"} I get an answer: {"error":"Title or Description not specified.","ok":false} . And the problem seems to be in the description part, because when I set in the ToDoController.go - > func CreateTodo() params.Description = "Hello" I get no error and the text will go to mongoDB.
I've tried to check of misspellings, but have not found any.
Any suggestions?
The text was updated successfully, but these errors were encountered: