You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI call to openapi-spec with security in path fails #242
Description:
The CLI call php-openapi validate example.spec.json fails due to the fact that the security in path is transformed to a list of arrays and not a list of objects in
I use this library to verify and merge yaml files into a single openapi yaml file. I have two security schemes as stated in example source below.
In most cases, I expect two of this security schemes to be used together (logical conjunction).
Since v1.8.0 this is broken and in generated yaml file only apiKey is used, ignores second one and bearerAuth is missing completely in endpoint definitions.
Example source yaml:
openapi: 3.0.0info:
title: API Documentationdescription: All API endpoints are presented here.version: 1.0.0servers:
- url: http://127.0.0.1:8080/paths:
/endpoint:
get:
responses:
'200':
description: OKsecurity:
- apiKey: []bearerAuth: []components:
securitySchemes:
apiKey:
type: apiKeyin: headername: X-APi-KeybearerAuth:
type: httpscheme: bearerbearerFormat: JWTdescription: JWT Authorization header using the Bearer scheme.
Activity
Fix cebe#242
SOHELAHMED7 commentedon May 15, 2025
Thanks for reporting.
This issue is fixed in PR #239
Commit: SOHELAHMED7@f669fef
Commit containing test: 6d5bde9
mkorkmaz commentedon May 16, 2025
Hi @SOHELAHMED7
I use this library to verify and merge yaml files into a single openapi yaml file. I have two security schemes as stated in example source below.
In most cases, I expect two of this security schemes to be used together (logical conjunction).
Since v1.8.0 this is broken and in generated yaml file only apiKey is used, ignores second one and bearerAuth is missing completely in endpoint definitions.
Example source yaml:
Generated output:
Fix cebe#242 (comment)
SOHELAHMED7 commentedon May 17, 2025
@mkorkmaz
Thanks for reporting.
This issue is fixed in 7b5f3da and 19fabbc (PR #239).
I have already added test for above scenario and I will add more of other scenarios
SOHELAHMED7 commentedon May 19, 2025
@cebe
PR #239 can be added to milestone 1.9.0
nadar commentedon Jun 5, 2025
We have the same issue, maybe release a patch? :-/
nadar commentedon Sep 3, 2025
bump, if you guide me into the direction @cebe i can send a PR