JSON parse error: Can not construct instance of io.starter.topic.Topic

For deserialisation purposes Topic must have a zero-arg constructor.

For example:

public class Topic {
    private String id;
    private String name;
    private String author;
    private String desc;

    // for deserialisation
    public Topic() {}    

    public Topic(String id, String name, String author, String desc) {    
        this.id = id;
        this.name = name;
        this.author = author;
        this.desc = desc;
    }

    // getters and setters

}     

This is the default behaviour of the Jackson library.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)