raml-java-parser icon indicating copy to clipboard operation
raml-java-parser copied to clipboard

Parser reports strange error when using security scheme with '.' in the name

Open petrochenko-pavel-a opened this issue 8 years ago • 5 comments

#%RAML 1.0
title: hello
securitySchemes:
  oauth2.0:
    type: OAuth 2.0
    settings:
      authorizationGrants: password
      authorizationUri: http
      accessTokenUri: http
      scopes:
      - a
      - b
/persons:
  get:
    securedBy:
      oauth2.0:
        scopes:
        - c

Thanks in advance, Pavel

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

petrochenko-pavel-a avatar Oct 11 '16 16:10 petrochenko-pavel-a

Using dots for constructs that could be imported from a library should be forbidden as it creates confusion regarding the intention of the dot and who should win in case of conflict, not sure the spec is clear about it.

svacas avatar Oct 13 '16 17:10 svacas

This works fine in RAML 0.8 as well as in current JS parser to, I see no clarifications in spec saying that this is dissalowed.

@sichvoge , @usarid what is your opinion? Regards, Pavel

petrochenko-pavel-a avatar Oct 14 '16 07:10 petrochenko-pavel-a

RAML 0.8 does not have the concept of libraries, so there's no ambiguity there regarding what a dot means.

svacas avatar Oct 14 '16 17:10 svacas

We could avoid the ambiguity by stating that, in case of ambiguities, local names win -- so a.b as a name is allowed and if there is such a name then it hides any a.b library reference. Anyone see any issues with this suggestion?

usarid avatar Nov 21 '16 21:11 usarid

Hi,

We've got the same issue on our side.

Any update ?

guiblondeau avatar May 16 '17 08:05 guiblondeau