swagger-php
swagger-php copied to clipboard
The Authorization specified in HeaderParameter cannot correctly try it out.
success #[OA\HeaderParameter(name: 'Authorization1', description: 'token', in: 'header', required: true, schema: new OA\Schema(type: 'string'))]
error #[OA\HeaderParameter(name: 'Authorization', description: 'token', in: 'header', required: true, schema: new OA\Schema(type: 'string'))]
Is Authorization a Keyword?why?
Could you provide some details about the error you are seeing?
There is nothing special about it in swagger-php. However, OpenApi has special handling for security - https://spec.openapis.org/oas/v3.1.0.html#security-scheme-object.
Instead of configuring a raw header the OA\SecurityScheme
annotation should be used, something like:
/**
* @OA\SecurityScheme(
* type="apiKey",
* securityScheme="http"
* )
*/
You might need to adjust type
for your needs and perhaps also use other options depending.