core
core copied to clipboard
Improve *Context operation options
#4881 added an openapi operation option to disable an operation from the OpenApi documentation. This option is in addition to the openapiContext which helps to send options to the OpenApi documentation for the dedicated operation.
In order to improve the DX and prevent confusions, those options should be merged in openapi, allowing to receive null (default), boolean and array values:
#[Get(openapi: false)] // the operation is not exposed on the OpenApi documentation
#[Get(openapi: null)] // (default value) the operation is exposed on the OpenApi documentation
#[Get(openapi: true)] // (similar to "null") the operation is exposed on the OpenApi documentation
#[Get(openapi: ['foo' => 'bar'])] // the operation is exposed on the OpenApi documentation, and a context is available
The same behavior could be done for hydraContext.
WDYT @api-platform/core-team?