How to define an array of enumerations in an API project

My proposed solution for the parameter section

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

But this failed with a semantic error:

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

+4
source share
1 answer

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

One possible solution to the MSON syntax, as I see it, is probably below:

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

Hope this helps and solves your thing Array of Enum.

+7
source

Source: https://habr.com/ru/post/1606279/


All Articles