Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Unable to override custon SecurityScheme settings #816

@vbartusevicius

Description

@vbartusevicius

Followed by https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#settings I created custom JWT security scheme and want to apply it with some overridden parameters as described in https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#applying-security-schemes

Take this RAML as example:

#%RAML 1.0
title: Secured API
securitySchemes:
  JWT:
    type: x-jwt
    describedBy:
      headers:
        Authorization:
          description: Valid Bearer jwt token
          type: string
          required: true
      responses:
        401:
          description: Bad or expired token.
        403:
          description: Access denied not valid privilage in resurces
    settings:
      issueUri: https://www.dropbox.com/1/oauth/authorize
      scope: [read, create]

/some-resource:
  get:
    securedBy:
      - JWT: { scope: [ read ] }
    description: Retrieve Some Resource

When parsed, it gives error:

[
  {
    "code": "UNKNOWN_NODE",
    "message": "Unknown node: 'scope'",
    "path": "api.raml",
    "range": {
      "start": {
        "line": 23,
        "column": 15,
        "position": 530
      },
      "end": {
        "line": 23,
        "column": 20,
        "position": 535
      }
    },
    "isWarning": false
  }
]

Cannot find anything wrong with RAML, it seems parser contradicts description given in specification that it is possible to override security scheme parameter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions