How to define ApiBlueprint array values example with MSON?

319 Views Asked by At

Can I use MSON to specify an example values instead of + Body? Is it possible to override predefined structure values?

I've tried like this:

+ Request (application/json)

    + Headers

            Authorization: JWT <token>    
    + Attributes (ClientsideCommand)
        + alias: `show-xc`
        + args (array[AppCommandArg], fixed-type)
            + (AppCommandArg)
                + arg_key: address
                + order: 1
                + required: true
                + skip_arg_name: true
            + (AppCommandArg)
                + arg_key: `-A1`
                + order: 2
                + required: true
                + skip_arg_name: false

But such definition corrupts json-schema, because AppCommandArg descibed as separate objects. And also in the JSON generated from the MSON has 3 items where first item is deafult AppCommandArg.

1

There are 1 best solutions below

0
Dr.eel On

Looks like it's not possible to make this things twogether. If you add elements as showed abowe Apiary renders it as it sees it, if an element noted twice the json schema also will describe it twice.