apiaryio / mson

Markdown Syntax for Object Notation
MIT License
903 stars 180 forks source link

Multiple sample values for array(list) of enum type #85

Closed davidkaya closed 7 years ago

davidkaya commented 7 years ago

Hello,

is there a way to define multiple sample values for an array(list) of some enum type?

Example:

## CarBrand (enum)
+ VW
+ Audi
+ Porsche

## StockInformation
+ availableBrands (array[CarBrand])

That renders

{ 
    availableBrands: [
        "VW"
    ]
}

however I would like to render sample with more than value from the enum. Something like:

{ 
    availableBrands: [
        "VW",
        "Audi"
    ]
}
kylef commented 7 years ago

Hi @davidkaya, that is possible.

You can add additional sample values under the array. As example:

# Data Structures

## CarBrand (enum)

+ VW
+ Audi
+ Porsche

## StockInformation

+ availableBrands (array[CarBrand])
    + Audi (CarBrand)
{
  "availableBrands": [
    "VW",
    "Audi"
  ]
}