-
Notifications
You must be signed in to change notification settings - Fork 95
CLI call to openapi-spec with security in path fails #242
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
Comments
Thanks for reporting. This issue is fixed in PR #239 Commit: SOHELAHMED7@f669fef Commit containing test: 6d5bde9 |
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: openapi: 3.0.0
info:
title: API Documentation
description: All API endpoints are presented here.
version: 1.0.0
servers:
- url: http://127.0.0.1:8080/
paths:
/endpoint:
get:
responses:
'200':
description: OK
security:
- apiKey: []
bearerAuth: []
components:
securitySchemes:
apiKey:
type: apiKey
in: header
name: X-APi-Key
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: JWT Authorization header using the Bearer scheme.
Generated output: openapi: 3.0.0
info:
title: 'API Documentation'
description: 'All API endpoints are presented here.'
version: 1.0.0
servers:
-
url: 'http://127.0.0.1:8080/'
paths:
/endpoint:
get:
responses:
'200':
description: OK
security:
-
apiKey: []
components:
securitySchemes:
apiKey:
type: apiKey
name: X-APi-Key
in: header
bearerAuth:
type: http
description: 'JWT Authorization header using the Bearer scheme.'
scheme: bearer
bearerFormat: JWT
|
Type: Bug
Since: 1.8.0
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 inphp-openapi/src/spec/SecurityRequirements.php
Line 64 in 893ab10
Minimal example.spec.json to reproduce:
I'll provide a MR with test case and a fix if you like.
The text was updated successfully, but these errors were encountered: