You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code exists in RestOpenApiProcessor.java in 4.8.0 and 4.8.1:
// the operation may have specific information what it can produceif (o.getResponses() != null) {
for (vara : o.getResponses().values()) {
Contentc = a.getContent();
if (c != null) {
produces = c.keySet().stream().sorted().collect(Collectors.joining(","));
}
}
}
In main, the code seems to have been refactored into OpenApiUtils.java:
publicStringgetProduces(Operationoperation) {
// the operation may have specific information what it can produceif (operation.getResponses() != null) {
for (varapiResponse : operation.getResponses().values()) {
Contentcontent = apiResponse.getContent();
if (content != null) {
returncontent.keySet().stream().sorted().collect(Collectors.joining(","));
}
}
}
returnnull;
}
In my case, I have a structure which looks like this:
operation
...
responses
{0}
key = "200"
value
...
content
{0}
key = "application/json"
value = ...
{1}
key = "400"
value
...
content
{0}
key = "application/problem+json"
value = ...
{2}
key = "404"
value
...
content
{0}
key = "application/problem+json"
value = ...
...
When running the code with 4.8.0, produces is set to application/problem+json. It should be set to application/json,application/problem+json instead.
The code from main also generates wrong result.
The text was updated successfully, but these errors were encountered:
Bug description
I found a bug in camel-rest-openapi.
The following code exists in RestOpenApiProcessor.java in 4.8.0 and 4.8.1:
In main, the code seems to have been refactored into OpenApiUtils.java:
In my case, I have a structure which looks like this:
When running the code with 4.8.0,
produces
is set toapplication/problem+json
. It should be set toapplication/json,application/problem+json
instead.The code from
main
also generates wrong result.The text was updated successfully, but these errors were encountered: