Configuring Spring Boot to use Gson instead of Jackson

This commit is contained in:
Umesh Awasthi
2019-01-01 15:04:56 -08:00
parent 33e9027819
commit a5cecec5c4
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
package com.javadevjournal;
import com.javadevjournal.data.Product;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ProductController {
@GetMapping("/product")
public Product getProduct(){
return new Product("123","Demo Product",123);
}
}

View File

@@ -0,0 +1,14 @@
package com.javadevjournal.data;
public class Product {
private String code;
private String name;
private double price;
public Product(String code, String name, double price) {
this.code = code;
this.name = name;
this.price = price;
}
}