We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In current attribute API is not possible to define the default security scheme.
The security attribute is not exposed on OpenApi\Attributes\OpenApi.
OpenApi\Attributes\OpenApi
As workaround, I inherited de attribute and rewrite the constructor.
#[\Attribute(\Attribute::TARGET_CLASS)] class CustomOpenApi extends OA\OpenApi { /** * @param Server[]|null $servers * @param Tag[]|null $tags * @param array<string,string>|null $x * @param Attachable[]|null $attachables */ public function __construct( string $openapi = self::DEFAULT_VERSION, ?Info $info = null, ?array $servers = null, ?array $tags = null, ?ExternalDocumentation $externalDocs = null, // annotation ?array $x = null, ?array $attachables = null, ?array $security = null // --- WORKAROUND ) { \OpenApi\Annotations\OpenApi::__construct([ 'openapi' => $openapi, 'x' => $x ?? Generator::UNDEFINED, 'security' => $security ?? Generator::UNDEFINED, //--- WORKAROUND 'value' => $this->combine($info, $servers, $tags, $externalDocs, $attachables), ]); } }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
In current attribute API is not possible to define the default security scheme.
The security attribute is not exposed on
OpenApi\Attributes\OpenApi
.As workaround, I inherited de attribute and rewrite the constructor.
The text was updated successfully, but these errors were encountered: