nestjs / docs.nestjs.com

The official documentation https://docs.nestjs.com 📕
MIT License
1.13k stars 1.61k forks source link

docs(exception-filters): correct status property #2991

Closed tomaszwysocki closed 2 months ago

tomaszwysocki commented 2 months ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

In #2988 status has been changed to statusCode, but it's inconsistent with an example:

image

I think it should be changed back to 'status,' or 'status' in the aforementioned example should be changed to 'statusCode.' It doesn't matter which. The case that @wilsonyiyi mentioned is irrelevant here. The docs say that we can pass an object, and there is no mention that it has to own a property called 'statusCode'.

To override just the message portion of the JSON response body, supply a string in the response argument. To override the entire JSON response body, pass an object in the response argument. Nest will serialize the object and return it as the JSON response body.

What is the new behavior?

Object properties used in the example will now remain consistent with the documentation.

Does this PR introduce a breaking change?

Other information

kamilmysliwiec commented 2 months ago

Thank you @tomaszwysocki