Search code examples
arraysparametersapiblueprint

How to supply example value for string array parameter in api-blueprint


I'm working with this API in api-blueprint.

## Variables [/Variables{?names}]

### Retrieve the variables [GET]

+ Parameter
    + names: `First` (array[string]) - The variables names.

I'm trying to set the default value for names to be multiple values

/Variables?names=first&names=second

but I can't figure out how to specify it. I've googled and can't figure out if this is supported or not. Hopefully someone here knows the answer.

A further edge case I've discovered is if the values are enumerated:

## Variables [/Variables{?names}]

### Retrieve the variables [GET]

+ Parameter
    + dataTypes: `Boolean,DateTime` (array[enum], required) - The variable data types. To request more than one data type, repeat the parameter
    e.g. dataTypes=Boolean&dataTypes=DateTime
        + Members
            + `Boolean` - The variable contains a boolean response (true / false).
            + `DateTime` - The variable contains a date / time response.
            + `MultipleCode` - The variable contains multiple selections from a collection of defined coded values.
            + `Numeric` - The variable contains a numeric response.
            + `SingleCode` - The The variable contains a single selection from a collection of defined coded values.
            + `Text` - The variable contains a text response.

It doesn't seem to matter if the type is (array, required) or (array[enum], required), I still get a semantic error.


Solution

  • + names: `first,second` (array) - The variables names.
    

    This should work just fine.