I am saving a object using spring data in a mongo db. But i can not see the created id return with the json response object.
@JsonInclude(JsonInclude.Include.ALWAYS)
@ApiModel(description = "Submission")
public class Submission {
@Id
private String submissionId;
private String assignmentId;
private String title;
}
public interface SubmissionRepository extends MongoRepository<Submission, String>{
}
Below is what i do inside the controller,
Submission sub= submissionService.createSubmission(submission);
return new ResponseEntity<>(sub, HttpStatus.CREATED);
Even the sub object has the submissionId populate, but it does not comes with the response json object as a property. Any clue what only submissionId is missing from reponse?
Even with get request the id is not coming with the response. I am using spring boot environment with spring-data-mongodb-1.6.3