Open cristalp opened 2 weeks ago
This relates to the issue https://github.com/smallrye/smallrye-open-api/issues/1895
The plain text is shown correctly, but during the build I still get messages like
io.smallrye.openapi.runtime.io.JsonIO parseValue INFO: SROAP02016: JSON value could not be parsed: 1200635948 1201860613 1201901219
This is a list of IDs and is defined like this:
private static final String RESPONSE_EXAMPLE_IDS = "1200635948\n" + "1201860613\n" + "1201901219";
And in the annotations:
@GET @Path("/expired") @Produces(MediaType.TEXT_PLAIN) @Operation(summary = "Bla bla") @APIResponses(value = { @APIResponse(responseCode = "200", description = "Yadda yadda", content = @Content(example = RESPONSE_EXAMPLE_IDS)) }) public Response getExpired( return ... }
The method declares that it produces plain text, so the Maven plugin should not try to parse the example return value as JSON.
Note that putting the example within an @ExampleObject shows the same behavior.
@ExampleObject
Of course, this is only a minor issue.
+1 the scanner should know that reading a response example (or request body example) with a non-JSON media type should not attempt to parse the string.
This relates to the issue https://github.com/smallrye/smallrye-open-api/issues/1895
The plain text is shown correctly, but during the build I still get messages like
This is a list of IDs and is defined like this:
And in the annotations:
The method declares that it produces plain text, so the Maven plugin should not try to parse the example return value as JSON.
Note that putting the example within an
@ExampleObject
shows the same behavior.Of course, this is only a minor issue.