Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser is failing on description within response #65

Closed
egiraudy opened this issue Jul 9, 2014 · 3 comments
Closed

Parser is failing on description within response #65

egiraudy opened this issue Jul 9, 2014 · 3 comments
Labels

Comments

@egiraudy
Copy link

egiraudy commented Jul 9, 2014

According to the specification, a response may contain a description (see below), but the api-console parser fails when there is such an element.

From http://raml.org/spec.html:

/media/{mediaid}/content:
displayName: Content
get:
description: |
Get a media file.
responses:
200:
body:
"/":
description: |
Returns the media file.

Responses MAY contain a description property that further clarifies why the response was emitted. Response descriptions are particularly useful for describing error conditions.

@usarid
Copy link

usarid commented Jul 9, 2014

Hmm, I just tried (in the APi Designer, which has the console embedded in it) and it's doing just fine:

#%RAML 0.8
title: Test
/:
  get:
    description: |
      The GET method
    responses:
      200:
        description: |
          The response to the GET method

What error are you getting, and could you attach the entire RAML file?

@egiraudy
Copy link
Author

egiraudy commented Jul 9, 2014

sorry, i should have been more accurate...

The parser fails when the description is under body or under the media-type:

Here is the error
"context":"while validating body","context_mark":null,"message":"property:
'description' is invalid in a body"

And here is an example:

#%RAML 0.8
title: Test
/:
get:
responses:
200:
body:
description: |
fail 1
application/xml:
description: |
fail 2

Also, after re-reading the spec, it is not clear if this is allowed of if
the example in the spec is wrong...

Thanks!

On Wed, Jul 9, 2014 at 9:21 AM, Uri Sarid notifications@github.com wrote:

Hmm, I just tried (in the APi Designer, which has the console embedded in
it) and it's doing just fine:

#%RAML 0.8title: Test/:
get:
description: |
The GET method
responses:
200:
description: |
The response to the GET method

What error are you getting, and could you attach the entire RAML file?


Reply to this email directly or view it on GitHub
#65 (comment).

@sichvoge
Copy link
Contributor

That is definitely not valid RAML and I can't find the example in the spec anymore. Closing it for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants