Skip to content

Commit 69b500d

Browse files
CopilotAniruddh25
andauthored
fix: rename currentRole to current-role in health check response (#3291)
## Why make this change? The `/health` endpoint response used `currentRole` (camelCase) while every other multi-word key in the response uses kebab-case (`app-name`, `cache-ttl-seconds`, `response-ms`, etc.), creating an inconsistent API surface. ## What is this change? - Updated `[JsonPropertyName("currentRole")]` → `[JsonPropertyName("current-role")]` in `ComprehensiveHealthCheckReport.cs`. **Before:** ```json { "status": "Healthy", "app-name": "dab_oss_2.0.0", "currentRole": "anonymous" } ``` **After:** ```json { "status": "Healthy", "app-name": "dab_oss_2.0.0", "current-role": "anonymous" } ``` ## How was this tested? - [ ] Integration Tests - [ ] Unit Tests ## Sample Request(s) ```http GET /health ``` Response now contains `current-role` instead of `currentRole`. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[Bug]: Health `currentRole` is inconsistent with the rest of the health report</issue_title> > <issue_description>## What? > > Rename `currentRole` to `current-role` to have consistent naming. > > ### Current `/health` output > > ```json > { > "status": "Healthy", > "version": "2.0.0", > "app-name": "dab_oss_2.0.0", > "timestamp": "2026-03-15T21:29:03.3354392Z", > "currentRole": "anonymous", // this is what I am talking about > "configuration": { > "rest": true, > "graphql": true, > "mcp": true, > "caching": false, > "telemetry": false, > "mode": "Development" > }, > "checks": [ > [snip] > ] > } > ````</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #3285 <!-- START COPILOT CODING AGENT TIPS --> --- 📍 Connect Copilot coding agent with [Jira](https://gh.io/cca-jira-docs), [Azure Boards](https://gh.io/cca-azure-boards-docs) or [Linear](https://gh.io/cca-linear-docs) to delegate work to Copilot in one click without leaving your project management tool. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
1 parent 2811fba commit 69b500d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Service/HealthCheck/ComprehensiveHealthReportResponseWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public async Task WriteResponseAsync(HttpContext context)
109109
// Ensure cachedResponse is not null before calling WriteAsync
110110
if (report != null)
111111
{
112-
// Set currentRole per-request (not cached) so each caller sees their own role
112+
// Set current-role per-request (not cached) so each caller sees their own role
113113
await context.Response.WriteAsync(SerializeReport(report with { CurrentRole = _healthCheckHelper.GetCurrentRole(roleHeader, roleToken) }));
114114
}
115115
else

src/Service/HealthCheck/Model/ComprehensiveHealthCheckReport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public record ComprehensiveHealthCheckReport
4646
/// <summary>
4747
/// The current role of the user making the request (e.g., "anonymous", "authenticated").
4848
/// </summary>
49-
[JsonPropertyName("currentRole")]
49+
[JsonPropertyName("current-role")]
5050
public string? CurrentRole { get; set; }
5151

5252
/// <summary>

0 commit comments

Comments
 (0)