I have a POJO class:
public class Stock { int id; String name; Date date; }
Are there any annotations or development framework/API that can co
public static String getJsonSchema(Class clazz) throws IOException { Field[] fields = clazz.getDeclaredFields(); List> map=new ArrayList>(); for (Field field : fields) { HashMap objMap=new HashMap(); objMap.put("name", field.getName()); objMap.put("type", field.getType().getSimpleName()); objMap.put("format", ""); map.add(objMap); } ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(map); return json; }