Oauth2 parsing issue

Hi there,

I am hitting brick wall with schema validation from within the app and web app.

Every time i add an oauth2 securitySchema, i keep getting the following error, i just cant work it out.

Any help would be much appreciated!

On line 25: /components/securitySchemes/oauth2 should have required property '$ref'

Here is my yaml:

openapi: 3.0.0
info:
  title: Wallet
  version: '1.0'
  description: The wallet APIs
  contact:
    name: Team
servers:
  - url: 'http://localhost:3000'
paths:
  /api/user:
    get:
      tags: []
      responses:
        '200':
          description: OK
      description: "Fetch the User's public profile"
      operationId: getUser
      security:
        - oauth2:
          - 'wallet:invoice'
components:
  schemas: {}
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize
          scopes:
            - 'wallet:invoice'
          tokenUrl: /oauth/token
          refreshUrl: /oauth/token

Hey there,

Thanks for the valuable feedback! The error its triggering is wrong but the specification is invalid. The “scope” section is invalid.