Background
Earlier in the week, late one night I was working with the
RAML data structure. It contains an array of resources,
each of which could in turn also have an array of resources inside of it. Each
resource also has an array of methods
, which in this case meant http verbs.
The structure from this perspective looks like this:
|
In the spec there is no guarentee that a resource will contain any methods. I wanted to take this multi-deminsional structure and flatten it into an array of resources where each resource had at least one method in it.