Configuring Spring Boot to use Gson instead of Jackson
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user