Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Example RAML in Optional Properties section is invalid #65

Open
eliaslevy opened this issue Jul 30, 2014 · 1 comment
Open

Example RAML in Optional Properties section is invalid #65

eliaslevy opened this issue Jul 30, 2014 · 1 comment

Comments

@eliaslevy
Copy link

The example resource type ins the Resource Types and Traits / Optional Properties section is invalid.

The resource type has to optional methods, a post and a delete, both of which attempt to define a parameters in the body of a request (createAuthority and deleteAuthority respectively). But the example defines these properties directly in the body property, which is invalid.

Per the the spec:

A method's body is defined in the body property as a hashmap, in which the key MUST be a valid media type.

Presumably the authors meant these parameters to be form parameters, as they are defined within a body. If that is the case, then they should have been defined under the formParameters property, which in turn should be under one of the two web form media types as keys in the body property.

E.g.

#%RAML 0.8
title: Example of Optional Properties
resourceTypes:
  - auditableResource
      post?:
        body:
          application/x-www-form-urlencoded:
            formParameters:
              createAuthority:
                description: |
                  If the resource has a post method defined, expect a createAuthority
                  property in its body
      delete?:
        body:
          multipart/form-data:
            formParameters:
              deleteAuthority:
                description: |
                  If the resource has a delete method defined, expect a deleteAuthority
                  property in its body
@advance512
Copy link

I also noticed this.

Also, please note that it should be:

  - auditableResource:

and not

  - auditableResource

which misses the colon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants