package com.github.solairerove.harald.application.dto.post;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.github.solairerove.harald.application.dto.comment.CommentResponse;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
@JsonTypeName(value = "post")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
public class PostResponse implements Serializable {

    private static final long serialVersionUID = 8221818444202026540L;

    @JsonProperty
    private Long id;

    @JsonProperty
    private String title;

    @JsonProperty
    private String author;

    @JsonProperty
    private String date;

    @JsonProperty
    private String content;

    @JsonProperty
    private List<CommentResponse> comments;
}

@@ -165,116 +165,8 @@
 ty;%0A
-import com.fasterxml.jackson.annotation.JsonTypeInfo;%0Aimport com.fasterxml.jackson.annotation.JsonTypeName;%0A
 impo
@@ -323,38 +323,8 @@
 ata%0A
-@JsonTypeName(value = %22post%22)%0A
 @Jso
@@ -366,92 +366,8 @@
 LL)%0A
-@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)%0A
 publ

change post json to correct type