Forum Discussion

HARSHD's avatar
HARSHD
Visitor
2 years ago

How to add string array in schema

While documenting schemas, tool is not accepting array of strings. Getting validation error as `items` must be an object.

 

Used syntax as below:

 

data:
                     type: array
                     items: 
                      - type: 
                        format: string
                        description: Entity type.
                      - id: 
                        type: string
                        description: Unique identifier 

 

  • chichepo's avatar
    chichepo
    Champion Level 1

    Hi HARSHD 

    I would recommend a more "traditional" construction:

    or, if you prefer: