Martin Tomec
Martin Tomec

Reputation: 88

How can I define array of enums in API blueprint

My supposed solution for parameters section is

+ fields: [firstField, secondField] (array[enum], optional)
  + Members
      + firstField
      + secondField
      + extraField
      + dummyField

But it failed on semantic error:

The example value [firstField, secondField] of parameter fields is not in its list of expected values

Upvotes: 6

Views: 1918

Answers (1)

Jakub Koral
Jakub Koral

Reputation: 368

I tried to understand your needs and wish for syntax of your API Blueprint.

One of possible solutions in MSON syntax as I see it is probably down below:

- fields (array, optional)
    - (enum)
        - firstField
        - secondField
        - extraField
        - dummyField

Hope it helps and solves your Array of Enum thing.

Upvotes: 8

Related Questions