Closed mblout closed 9 years ago
I had to look at the format, you pasted this:
#%RAML 0.8
title: Test Service
baseUri: http://sometest.org/mobile/platform/test
version: 1.0
mediaType: application/json
protocols: [HTTPS]
traits:
- sql:
headers:
test-Mobile-Sql:
description: blah blah blah
type: string
required: true
example: |
SELECT "title" from "Movies"
/sql:
description: |
blah blah blah
get:
description: blah blah blah
is: [ sql ]
queryParameters:
argX:
description: blah blah blah
type: string
parameterX:
description: blah blah blah
type: string
responses:
200:
body:
application/json:
example: |
[{ "title" : "The Imitation Game"}]
The test-Mobile-Sql
header is wrongly indented, and the error message is in line 11
which it expects to be a mapping (a hash), but is a string... you should have something like:
#%RAML 0.8
title: Test Service
baseUri: http://sometest.org/mobile/platform/test
version: 1.0
mediaType: application/json
protocols: [HTTPS]
traits:
- sql:
headers:
test-Mobile-Sql:
description: blah blah blah
type: string
required: true
example: |
SELECT "title" from "Movies"
/sql:
description: |
blah blah blah
get:
description: blah blah blah
is: [ sql ]
queryParameters:
argX:
description: blah blah blah
type: string
parameterX:
description: blah blah blah
type: string
responses:
200:
body:
application/json:
example: |
[{ "title" : "The Imitation Game"}]
ooof, my bad [confirmed]. thanks!
I'm getting a validation error on the following (snippet) - it flags the 'description' (the first item) as an error - "each header must be a map'.
[see this line in validate_headers: if (!(util.isNullableMapping(param[1]) || util.isNullableSequence(param[1])))]
Here's my RAML, defining headers in a trait: