apiblueprintmson

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


Solution

  • 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.