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.

Parser fails if settings are present for custom security scheme #82

Description

@osennatl

When presented with a RAML file that contains a custom (x-{other} type) security scheme with settings, the library is failing with the following exception:

java.lang.RuntimeException: Builder not found for <NodeTuple keyNode=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:str, value=setting1)>; valueNode=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:str, value=value)>>
    at org.raml.parser.builder.DefaultTupleBuilder.getBuilderForTuple(DefaultTupleBuilder.java:68)
    at org.raml.parser.visitor.YamlDocumentBuilder.onTupleStart(YamlDocumentBuilder.java:272)
    at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:145)
    at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
    at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
    at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
    at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
    at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
    at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
    at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
    at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
    at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
    at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
    at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
    at org.raml.parser.visitor.NodeVisitor.visitSequence(NodeVisitor.java:247)
    at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:226)
    at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
    at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
    at org.raml.parser.visitor.NodeVisitor.visitDocument(NodeVisitor.java:209)
    at org.raml.parser.visitor.YamlDocumentBuilder.build(YamlDocumentBuilder.java:90)
    at org.raml.parser.visitor.YamlDocumentBuilder.build(YamlDocumentBuilder.java:102)
    at org.raml.parser.visitor.YamlDocumentBuilder.build(YamlDocumentBuilder.java:78)
...

The following RAML snippet can be used to reproduce the problem:

securedBy: [jwt]
securitySchemes:
    - jwt:
        type: x-jwt
        settings:
           setting1: value

We are using version 0.8.12.

Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-141

Activity

  1. KevinMitchell commented on Feb 12, 2018

    @KevinMitchell

    The latest parser, 1.0.17, still has problems with settings.

    I try

    securitySchemes:
      x-jwt:
        type: x-jwt
        settings:
          scope: string
    

    and the parser complains with

    Unexpected key 'settings'. Options are : "describedBy" or "description" or "displayName" or "type" or /\((.+)\)/
    

    This looks like it should be valid RAML according to the spec...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions