lbvirgo lbvirgo - 7 months ago 41
JSON Question

Is there a way to hardcode "response" in @ApiResponse annotation of swagger?

I've the below Swagger annotation for one of my api methods:

@ApiResponse(code = 200, message = "OK", response = String.class)

Is there a way I can hard-code the

I'm NOT keeping any domain objects in my service; my service is a kind-of wrapper service that connects with a third party vendor service and returns the json as-it-is to the caller.
So, is there a way I can hardcode the json schema in the
element ?

I know that if I define a domain object and mention its
, I'll get the json schema in the output but as I mentioned I need to find a way without defining a domain object.

Also providing the hardocded json schema in
attribute will not make sense as because, I believe, this attribute is more for describing the status
, correct ?

Thanks to provide any pointers/suggestions.


I got few suggestions on other forum.