redoc icon indicating copy to clipboard operation
redoc copied to clipboard

Customizable "required" label value

Open alessandrorubio opened this issue 2 years ago • 3 comments

Describe the problem to be solved I'm currently using redoc to expose a documentation of my API for my consumers. The API itself is generated with openapi generator which also generates the client in form of a package. Such package is used in another service of mine. I want to properly annotate what property is not nullable.

If I do something like

required:
    - propertyA

in the redoc result page, such property will be having a "required" word... this case is present in your demo page in here. Taking that as an example, it doesn´t make sense to mark as "required" properties in the result body like so:

Screenshot 2023-09-09 at 19 53 59

Is it there a way to change this "required" keyword for something like "Non nullable" or simply not showing it?

If not, consider this an enhancement for additional customization

Take in mind that is not only tech people who will read the redoc's generated page and this is something that can cause confusion.

alessandrorubio avatar Sep 09 '23 17:09 alessandrorubio

Hi @alessandrorubio,

Could you please confirm if my understanding is correct that you would like to show the "required" keyword for the request schemas and hide/customize it for the responses only?

romanpryshliak avatar Sep 12 '23 12:09 romanpryshliak

Hi @alessandrorubio,

Could you please confirm if my understanding is correct that you would like to show the "required" keyword for the request schemas and hide/customize it for the responses only?

Yes, correct

alessandrorubio avatar Sep 13 '23 09:09 alessandrorubio

Hi @alessandrorubio, you can use decorators for it.

AlexVarchuk avatar Sep 15 '23 13:09 AlexVarchuk