• Post Reply Bookmark Topic Watch Topic
  • New Topic

The output of the getStopsName() method is null  RSS feed

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am trying to parse JSON file with the Jackson library since I want to inject my database with the jsonfile.txt. Currently I have the Problem that the output of String stop_name = stop.getStopsName();System.out.println(stop_name); null is. Everything else is being Output. How can I fix that?

I appreciate any help.


JSON:




Root class:


Injection class:

 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your JSON has the property as stop_name but in your mapping you have @JsonProperty("stops_name")
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!