Selection among array type

This code below ALMOST does what I want:

  Measurements: 
    properties:
      msmts1?:
        type: array:
        items: BpMsmtChar
      msmts2?: 
        type: array
        items: GlucMsmtChars 

I have previously defined the BpMsmtChar and GlucMsmtChars types.

However, what I really want to do is present a choice. It is either this:

  Measurements: 
    properties:
      msmts?:
        type: array:
        items: BpMsmtChar
[/details]

or this

  Measurements: 
    properties:
      msmts?: 
        type: array
        items: GlucMsmtChars 

I actually have more measurement type arrays I want to select among but you get the idea. What is the proper way to define a selection among possible the possible measurement arrays?

Measurements: BpMsmtChar | GlucMsmtChars

renders nicely in raml2html but

Measurements: BpMsmtChar[] | GlucMsmtChars[]

does not. Neither is what I want because I need the msmts keyword in the JSON

The last form should work. I advise you file an issue on the raml2html repo.

What do you mean by:

I need the msmts keyword in the JSON

?

I was using the same keyword twice (msmts?:slight_smile: which is not a good idea. In any case I could not get Measurements: BpMsmtChar | GlucMsmtChars to render. I take it this is okay as far as raml is concerned?

Thanks

It’s valid as far I can tell. What is the error you are getting?