gmunozfe commented on code in PR #4078:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4078#discussion_r2536797054


##########
kogito-codegen-modules/kogito-codegen-processes/src/main/resources/class-templates/RestResourceQuarkusTemplate.java:
##########
@@ -88,10 +91,23 @@ public class $Type$Resource {
     }
 
     @GET
-    @Produces(MediaType.APPLICATION_JSON)
+    @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_HTML})
     @Operation(operationId = "getAllProcessInstances_$name$", summary = 
"$documentation$", description = "$processInstanceDescription$")
-    public List<$Type$Output> getResources_$name$() {
-        return processService.getProcessInstanceOutput(process);
+    public Response getResources_$name$(@Context HttpHeaders headers) {
+        List<$Type$Output> out = 
processService.getProcessInstanceOutput(process);
+        boolean wantsHtml = headers.getAcceptableMediaTypes()
+            .stream()
+            .anyMatch(mt -> mt.isCompatible(MediaType.TEXT_HTML_TYPE)
+                    && !mt.isWildcardType() && !mt.isWildcardSubtype());

Review Comment:
   `MediaType.isCompatible(TEXT_HTML_TYPE) ` already excludes generic ` */*`, 
so these extra checks are redundant.
   ```suggestion
                     );
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to