0

How do I specify in MSON that an array should only contain types A, B or C, and not any other types?

I've tried

+ myField (array[A], fixed-type, required)

but the JSON schema generated by aglio only requires the first element of the array to be of type A.

Robin Green
  • 32,079
  • 16
  • 104
  • 187
  • Keep in mind Aglio is using an outdated version of the parser which might probably contain bugs. You might want to try it on Apiary.io first. – Vincenzo Oct 10 '16 at 14:48

1 Answers1

0

The fixed-type feature of MSON is relatively new. If you've had Aglio installed for a while, you are probably using an older version of the parser. You can uninstall/reinstall it and see if it'll pick up the latest version of the protagonist library (which includes the feature), or you can install from Github which supports the new drafter library and should see a release soon. One of the big benefits there is that it no longer requires a compiler to install.

Daniel
  • 8,212
  • 2
  • 43
  • 36