Closed jbrauchler closed 9 years ago
@jabr9983 Could you try fixing up the snippet to have the proper whitespace? I can't see anything wrong around the error you're indicating.
Actually, looking at the error message I think you have a non-printable character on line 7. The error message actually tells you what the character is, but since you can't read it it just says "... character that ...".
Hi @jabr9983 you cannot use tabs to indent YAML, and hence RAML.
Check answer 2 in the faq: http://www.yaml.org/faq.html
I still can't get this functioning even with just using spaces rather than tabs, I am still getting the same error though. I have ran the project through a yaml checker and it says it is formatted correctly.
Can you re-share the RAML without tabs? (make sure to put it in ``` so that it is easier to see)
Yes I have a meeting to attend here but as soon as I return I will get that posted thanks, for your help.
Here is part of my RAML:
'"#%RAML 0.8
title: Todo API
version: v1
baseUri: http://localhost:3000
protocols: [HTTP, HTTPS]
mediaType: application/json
/tasks:
get:
description: Get a list of all Tasks.
responses:
200:
body:
application/json:
example: |
{
"tasks": [
{
"_id": "556f927e265f627993000012",
"description": "Make dinner",
"name": "task1",
"date_created": "2015-06-03T23:49:18.059Z"
},
{
"_id": "55705da20f014efb93000009",
"description": "Watch your sister",
"name": "task2",
"date_created": "2015-06-04T14:16:02.087Z"
},
{
"_id": "557069295ec4d36d94000006",
"description": "Meeting at 9:30",
"name": "task3",
"date_created": "2015-06-04T15:05:13.612Z"
},
{
"_id": "557088e7c08d7e6495000001",
"description": "Go home",
"name": "task4",
"date_created": "2015-06-04T17:20:39.330Z"
}
{
"_id": "55708ee2efba7e9d95000009",
"description": "Go to bed",
"name": "task5",
"date_created": "2015-06-16T1904T17:46:10.530Z"
},
{
"_id": "55807c154790bb000000003a",
"description": "Eat Dinner",
"name": "task 6",
"date_created": "2015-06-16T19:42:13.798Z"
}
]
}'"
There are still tabs all over the place:
Okay I guess I'm confused are you not supposed to space at all I didn't tab I just did 2 spaced between each.
On Thu, Jun 18, 2015 at 10:24 AM, Damian Martinez Gelabert < notifications@github.com> wrote:
There are still tabs all over the place:
[image: image] https://cloud.githubusercontent.com/assets/1099335/8236220/4c52cff0-15bd-11e5-94a9-4d8f86959c0a.png
— Reply to this email directly or view it on GitHub https://github.com/raml-org/raml-js-parser/issues/149#issuecomment-113208479 .
Even like this it doesn't work.
'"#%RAML 0.8
title: Todo API
version: v1
baseUri: http://localhost:3000
protocols: [HTTP, HTTPS]
mediaType: application/json
/tasks:
get:
description: Get a list of all Tasks.
responses:
200:
body:
application/json:
example: |
{
"tasks": [
{
"_id": "556f927e265f627993000012",
"description": "Make dinner",
"name": "task1",
"date_created": "2015-06-03T23:49:18.059Z"
},
{
"_id": "55705da20f014efb93000009",
"description": "Watch your sister",
"name": "task2",
"date_created": "2015-06-04T14:16:02.087Z"
},
{
"_id": "557069295ec4d36d94000006",
"description": "Meeting at 9:30",
"name": "task3",
"date_created": "2015-06-04T15:05:13.612Z"
},
{
"_id": "557088e7c08d7e6495000001",
"description": "Go home",
"name": "task4",
"date_created": "2015-06-04T17:20:39.330Z"
}
{
"_id": "55708ee2efba7e9d95000009",
"description": "Go to bed",
"name": "task5",
"date_created": "2015-06-04T17:46:10.530Z"
},
{
"_id": "55807c154790bb000000003a",
"description": "Eat Dinner",
"name": "task 6",
"date_created": "2015-06-16T19:42:13.798Z"
}
]
}'"
You need to indent, you had the right idea at first, but indentation must be with spaces:
#%RAML 0.8
title: Todo API
version: v1
baseUri: http://localhost:3000
protocols: [HTTP, HTTPS]
mediaType: application/json
/tasks:
get:
description: Get a list of all Tasks.
responses:
200:
body:
application/json:
example: |
{
"tasks": [
{
"_id": "556f927e265f627993000012",
"description": "Make dinner",
"name": "task1",
"date_created": "2015-06-03T23:49:18.059Z"
},
{
"_id": "55705da20f014efb93000009",
"description": "Watch your sister",
"name": "task2",
"date_created": "2015-06-04T14:16:02.087Z"
},
{
"_id": "557069295ec4d36d94000006",
"description": "Meeting at 9:30",
"name": "task3",
"date_created": "2015-06-04T15:05:13.612Z"
},
{
"_id": "557088e7c08d7e6495000001",
"description": "Go home",
"name": "task4",
"date_created": "2015-06-04T17:20:39.330Z"
}
{
"_id": "55708ee2efba7e9d95000009",
"description": "Go to bed",
"name": "task5",
"date_created": "2015-06-16T1904T17:46:10.530Z"
},
{
"_id": "55807c154790bb000000003a",
"description": "Eat Dinner",
"name": "task 6",
"date_created": "2015-06-16T19:42:13.798Z"
}
]
}
this works BTW ^^^ (use backticks, not singlequotes for code fences
Okay thanks
I am getting this error when trying to parse my raml file. Error parsing: while scanning for the next token found character that cannot start any token in "Todo.raml", line 7, column 1 I don't know what I am doing wrong. Any guidance would be great. This is my raml file: