-
-
Notifications
You must be signed in to change notification settings - Fork 111
Health check API doesn't return health indicator result when data have status property #2668
Copy link
Copy link
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
In @nestjs/terminus version 11.0.0, when calling either HealthIndicatorResult.up() or HealthIndicatorResult.down() with a data object that includes a status key, the corresponding health indicator is not included in the final response of the health check API.
Minimum reproduction code
Check this repository: https://github.com/Coalery/nestjs-terminus-bug-reproduce
Steps to reproduce
No response
Expected behavior
Health indicators that return a status field in their data should still be included in the final response.
If status is a reserved keyword, I think it should either:
- Be handled separately from user's data, or
- Be validated to only accept
'up' | 'down', or - Be disallowed from being set in user data, with clear documentation or runtime validation
This behavior was not present in v10 and appears in v11.
Package version
11.0.0
NestJS version
11.1.5
Node.js version
20.12.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
Reactions are currently unavailable