How to define a Map type property wich may contain any number of key-values


I am novice to RAML, try to write specification for an api. I am having issue in designing response body for an object which contains a property (Map type collection) to hold any number of keys and values. Please help me. In attached picture, there is property “collections” inside “adhocMetaData” object. This “collections” property may get any number of key-value pairs on different requests. How can define this propery while writting responsebody example in raml. Somebody please help me


Can you share your RAML?


I believe you can use regex as property keys.

#%RAML 1.0 DataType
    type: string
description: key -> dimension, value -> image url

Above data type will allow examples like below.

  "110x110": "",
  "640x640": ""

Or you could set additionalProperties to true to pass any example validation and use description node for describing its structure.