I have 2 simple files in my project (which is designed to test the new MuleSoft JWT Validation policy).
I have a simple main RAML file in the ‘root’ folder:
#%RAML 1.0
version: v1
title: #removedFromCodeSample
baseUri: #removedFromCodeSample
uses:
jwt: !include traits/jwt.raml
/check:
get:
is: [jwt.jwt]
headers:
token: string
responses:
200:
headers:
x-oauth-policy: string
and a trait in an external file at traits/jwt.raml
#%RAML 1.0
title: jwt
traits:
jwt:
headers:
authorization:
description: Bearer <JWT>
type: string
responses:
400:
description: Token was not provided.
401:
description: Bad or expired token. To fix, you should re-authenticate the user.
403:
description: The client id validation failed.
503:
description: Error communicating with JWKS server.
(everything from the word “traits” down is directly copy-pasted from Anypoint’s instructions!)
This is fine in Anypoint Design Center, but when I try to build it in MuleSoft’s Anypoint Studio it throws an error saying that “The included resource /traits/jwt.raml contains errors”
This is obviously attached to the main RAML file that includes the trait file, however there are no errors shown in the trait file itself. When I paste the trait into the main file, it works fine. Is this a problem with the parser/studio application or have I done something wrong in my RAML?