I am using Spring boot with mvc. I have a json schema for request and response. Basically the user posts data (in json) to a url, the controller does its logic and returns a json. I am having difficulty in returning the json. So far, I have a couple of views (in thymeleaf) with hardcoded responses which I dont want. I just want to use an object which I can edit and send back to the client. The response is very simple. This is the schema of the response:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message":{
"minLength":1,
"type":"string"
}
},
"required": [
"message"
]
}
I have an object of type response which conforms to my response json schema. I basically want to output this object to the client. But not sure how as my controller returns a String and this string is usually the name of the html page.