Nest resources under node?


#1

Is there any valid way to create a document structure that will allow nesting of the resource mappings under another object node?

Something like this:

myNode
/resource
/{str}
/etc
/foo
/bar

? (Note that indention does not seem to be appearing in post)


#2

Yes there is a button for doing indentions. Its above the comment text box; the six from left hand side.


#3

Ah here we go thanks.

Is something like this possible in raml?

#%RAML 1.0
title: foobar
(myNode):
  /resource:
     /{str}:
        get:

From what I’ve read I don’t think that’s possible, but I wanted to check.


#4

So you have an annotation with myNode as key and a resource node as value?


#5

That is right… a myNode key, with a resource mapping object as value.

So in JSON it’d look like this:

{
  "title": "foobar",
  "(myNode)": 
     { 
        "/resource": { "{str}": {  "get": { ... } } }
     }
}

#6

That is not really working as the value of an annotation is defined as a type. What do you want to achieve, maybe there is another solution.