-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
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
Non serializable configuration when using global security #10
Comments
@vyuldashev could this be solved by providing custom |
@matthew-inamdar I guess so. Probably in BaseObject would be enough. |
Method __get_state should be added too. |
I added by extending SecurityRequirement class and got same problem with GoldSpecDigital\ObjectOrientedOAS\Utilities\Extensions class. |
@marezelej Did you get this working? I’m running into the same problems. |
@andrewminion-luminfire yes... It is not the best solution but worked for me. |
Thanks @marezelej! |
goldspecdigital/oooas#56 should fix this |
Solution based on https://github.com/symplify/vendor-patches:
'security' => [
[
'BearerToken' => []
],
],
* @param array $security
* @return static
*/
public function security($security): self
{
$instance = clone $this;
$instance->security = [$security] ?: null;
return $instance;
}
|
When configuring global security it is not posible to use config:cache command as it breaks with the "Your configuration files are not serializable." exception.
At config/openapi.php:
'security' => [ GoldSpecDigital\ObjectOrientedOAS\Objects\SecurityRequirement::create()->securityScheme('oauth2'), ],
Exception:
I solved the issue using an array for the security specification, but had to override the GoldSpecDigital\ObjectOrientedOAS\OpenApi class.
The text was updated successfully, but these errors were encountered: