Steeltoe icon indicating copy to clipboard operation
Steeltoe copied to clipboard

Mappings actuator should add "Produces" - Media type information

Open hananiel opened this issue 4 years ago • 4 comments

To support App Live view, need to add a "Produces" field that reports the MediaType. Refer to the SpringBoot implementation to match it closely if possible.

hananiel avatar Aug 30 '21 15:08 hananiel

After investigation, the produces field on a spring boot app falls under the "details" section. The ALV team will adjust for this difference, since the rest of the "details" section is not applicable to dotnet apps.

hananiel avatar Sep 15 '22 14:09 hananiel

I can't tell from the original issue or the comment update: does the mappings actuator already include similar detail of what media type is supported for any given endpoint in a different location or way? Is that information needed?

TimHess avatar Sep 15 '22 16:09 TimHess

from a springboot app:

"dispatcherServlets": {
  "dispatcherServlet": [
     {
    "handler": "Actuator web endpoint 'configprops'",
    "predicate": "{GET [/actuator/configprops], produces [application/vnd.spring-boot.actuator.v3+json || application/vnd.spring-boot.actuator.v2+json || application/json]}",
      "details": {
        "handlerMethod": {
              "className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
              "name": "handle",
              "descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
               },
        "requestMappingConditions": {
              "consumes": [],
              "headers": [],
              "methods": [ "GET" ],
              "params": [],
              "patterns": [ "/actuator/configprops" ],
              "produces": [
                 { "mediaType": "application/vnd.spring-boot.actuator.v3+json", "negated": false },
                 { "mediaType": "application/vnd.spring-boot.actuator.v2+json", "negated": false },
                 { "mediaType": "application/json", "negated": false }
                 ]
                }
         }
   },
...

Steeltoe App:

"contexts": {
"application": {
"mappings": {
"dispatcherServlets": {
"Steeltoe.Actuators.Controllers.EmployeeController": [
{
"handler": "System.Collections.Generic.IEnumerable`1[Steeltoe.Actuators.Models.Employee] Get()",
"predicate": "{[api/Employee],methods=[GET],produces=[text/plain || application/json || text/json]}"
},

hananiel avatar Sep 19 '22 16:09 hananiel

Note the produces section is already available but at the predicate level.

hananiel avatar Sep 19 '22 16:09 hananiel