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

Global (api level) security ignored when resolving operation#securityDefinitions in OAS3 #218

Closed
wickedest opened this issue Jan 22, 2020 · 1 comment

Comments

@wickedest
Copy link

wickedest commented Jan 22, 2020

Expected outcome

Given an OAS 3.0 spec that defines securitySchemes component (e.g. api-key) and a global security Requirement Object, the operation.securityDefinitions should be {"api-key":{"in":"query","name":"apikey","type":"apiKey"}}".

openapi: 3.0.0
servers:
  - description: Sample API
    url: https://sample.io
info:
  description: My sample service
  version: "1.0.0"
  title: Sample API
security:
  - api-key: []
paths:
  /doit:
    get:
      description: Get something
      operationId: getSomething
      responses:
        default:
          description: Success
components:
  securitySchemes:
    api-key:
      in: query
      name: apikey
      type: apiKey

Actual outcome

The operation.securityDefinitions is empty {}.

The issue may be related to this code in operation.js - securityDefinitions is undefined in OAS3. Instead, they were renamed to components.securitySchemes and the equivalent should be accessible at pathObject.api.definitionFullyResolved.components.securitySchemes.

@whitlockjc
Copy link
Member

OASv3 isn't supported yet, I apologize. Please use #128 to keep track of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants