Closed greenrd closed 9 years ago
Not sure how relevant this is, but 2 other RAML validators (ramlev and raml-validator) think my RAML is OK.
Here's a simple RAML file that reproduces the issue:
#%RAML 0.8
---
title: Example RAML API
baseUri: https://mydomain.com/api/{version}
version: v1
resourceTypes:
- myCollection:
get:
responses:
200:
body:
application/json:
schema: |
{
"type": "string"
}
example: |
<<exampleCollection>>
/site:
type:
myCollection:
exampleCollection: !include example/sites.json
Issue manifests as:
Message: Schema invalid: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'example': was expecting ('true', 'false' or 'null')
This is an issues of the raml parser. I created an issue for it: https://github.com/raml-org/raml-java-parser/issues/80 I'll have a look if I can fix it temporarily in raml-tester.
I don't think I can do anything here. Because raml-tester does not see the !include
, it cannot know when to manually include a file.
Added a patched version of raml-java-parser's TemplateResolver. This should help.
Just saw this is already fixed, but the version containing the fix is not on maven central :-1:
If I pass an included file to a resource type, like this:
then when validating the RAML, instead of reading the file
example/sites.json
, it just behaves as if the!include
keyword wasn't there, and tries to parse the filename as if it were JSON.Here is the relevant part of the stacktrace:
This is with raml-tester 0.8.4.