Java Spring boot REST API project often demands to have responses in a particular format and hence this session will be extremely useful for java spring boot developers who are particularly developing REST APIs. Kindly watch the complete session to get complete benefit from this. GitHub link for CloudVendorApi code - github.com/thinkconstructive/rest-api-spring-boot-demo/tree/master Happy learning. Cheers, Esha
Thank you for how to create custom json response. could you make a video to get and access C# json response in springboot app using java. because C# json response contains meta field, data field and status field.
Hi, Currently, I don't have Spring framework video available on my channel. That will surely be available in future here. Meanwhile, you can refer "spring.io/" website and also can read book - "Spring in Action" by Manning publication.
Hi Your explanation is very clear. I have few questions.. Why don't you just create generic object contains T response, String status and String message? In addition, you can use Lombok builder or to implement builder by yourself..
@@sebastiansagrario8684 Use the following Java annotations on top of the the Response handler class. @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) and @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY) Which will elemenate the Null and Empty values in the output, but make sure that you also use the field validation annotations to don't miss out the mandate fields. This might be helpful for you..! Happy Learning.. 😊
Hi can you make session on Spring security For enterprise level application That would be helpful for me and my friends Who are working on the project Thanks in anticipation Yarra Raviteja
thanks mam for showing the new way to achieve custom response... i have achieved this result by creating lots of DTO classes...but now i got this technic...thanks again for creating awesome content...
For providing customise responses as discussed in the session, Custom response handling is better otherwise simple ResponseEntity is sufficient. It depends on the requirement.
Hello ma'am I think you also perform change on service package like CloudVendorService and it's implementation class because this method comes from service package. Thank you.
I did this and it worked! public List getAllCloudVendorDetails(){ //return new CloudVendor("C1","Vendor name","Address one","xxxxxxx"); List list = cloudVendorService.getAllCloudVendors(); List newList = new ArrayList(); for (CloudVendor cloudVen : list){ System.out.println(cloudVen + ""); newList.add(ResponseHandler.responseBuilder ("Response Vendor details are given here", HttpStatus.OK,cloudVen)); } return newList;