Postman posting null values to database

I’m post json body to my api and one column is being stored as null in my database

Here is my posting of json body

One column is stored as null

Entity

controller

service layer

I have tried multiple databases like h2 same problem with every database

  • 2

    #1 Post the code, not the images. #2 Print the values to the console before the insert and share us the result #3 Markdown for images is ![foo](url image). Check gist.github.com/jrichardsz/… #4 If you want a direct help, use github to upload a minimal reproducible example stackoverflow.com/help/minimal-reproducible-example

    – 




  • My guess is that “Role” is not being bound from JSON as it does not follow the JavaBeans naming convention. Please dont post images of code – you are likely to get downvoted: idownvotedbecau.se/imageofcode

    – 




My Humble suggestion is to put the attribute ‘Role’ in small case ‘role’,

Private String role;

and I advise you to use DTO in the data transferring process, instead of the entity itself.

Leave a Comment