Closed
Description
Version 1.4.8. Default configuration. Running:
curl http://localhost:8080/v3/api-docs
Returns:
"{\"openapi\":\"3.0.1\",\"info\":{\"title\":\"OpenAPI definition\",\"vers...
I replaced the remainder of the response by "...", because it is already clear, that this is not the spec in json, but: spec in json encoded in a json string. Response should be:
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","vers...
The problem is the content type definition and the String return type:
@GetMapping(value = API_DOCS_URL, produces = MediaType.APPLICATION_JSON_VALUE)
public String openapiJson(HttpServletRequest request, @Value(API_DOCS_URL) String apiDocsUrl)
throws JsonProcessingException {
If Spring "knows" how to convert to Json, it will convert the returned string value to a Json string (the observed result).
A plain text content type might help, or returning the actual object when Spring knows how to convert to Json.
Metadata
Metadata
Assignees
Labels
No labels