Skip to content

Tag: rest

Mapping nested JSON values in a Java class

I can’t figure out how to handle nested JSON values in my Java classes. To make it simple as possible, I created four Java classes with every ‘nested level’. However, I’m trying to have all these values in one Java class. How can I do this? Json: Java classes: Answer You can club all t…

How to properly filter Spring REST data

I have a Spring Data REST service with a single @Entity and Repository. When I run $ curl localhost:8080/api I get all the data stored in my repository and it works as expected. I also have a small React front end and I display that data there. My question is: Where should I filter the data? For example maybe…

Passing List in @RequestHeader Restapi

I want to pass list of string in my controller via Request Header @RequestHeader(“list”) final List<String> listOfString. Can this be used. How can I pass list of string in header via Postman? list={item1,item2,item3}. This is not working while I want to test via Postman. Is there any way? A…