Skip to content
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

Empty SecurityRequirement in YAML file #46

Closed
NukeBoy opened this issue Nov 28, 2019 · 2 comments · Fixed by #59
Closed

Empty SecurityRequirement in YAML file #46

NukeBoy opened this issue Nov 28, 2019 · 2 comments · Fixed by #59
Labels
bug Something isn't working needs investigation Work is needed to figure out the root cause of the problem.
Milestone

Comments

@NukeBoy
Copy link

NukeBoy commented Nov 28, 2019

When trying to write a Security Requirement object to a YAML file:
$openapi->security = [new SecurityRequirement(['Bearer' => []])];
The result is:

security:
        -
          Bearer: {  }

When expected:

security:
        -
          Bearer: []

When writing to a JSON file, everything is fine:

"security": [
    {
         "Bearer": []
    }
]
@cebe
Copy link
Owner

cebe commented Dec 2, 2019

seems symfony/yaml is interpreting this wrong... not sure how to solve it, if it would print an array intead of object we could just pass a stdClass object, but I don't know a way to force the type the other way round...

@cebe cebe added bug Something isn't working needs investigation Work is needed to figure out the root cause of the problem. labels Dec 2, 2019
@cebe cebe modified the milestones: 1.3.2, 1.4 Dec 2, 2019
@coatesap
Copy link

coatesap commented Jan 2, 2020

Potential fix for this suggested in #52

cebe added a commit that referenced this issue Mar 6, 2020
@cebe cebe closed this as completed in #59 Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation Work is needed to figure out the root cause of the problem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants