Redoc: Should "Array of" be displayed for arrays of objects?

Created on 25 May 2017  路  4Comments  路  Source: Redocly/redoc

Hi,

If a property is an array of strings, ReDoc displays "Array of string" for the property. However, if the property is an array of objects, ReDoc just displays "object" or the title of the object (or the name of the model definition) - the text "Array of" is not displayed.

This can be quite confusing, because until you expand the property and see that it says "Array [ ... ]", the property looks identical to an object.

So would it be possible to display "Array of" for arrays of objects?

For an example, consider this snippet:

          schema:

            type: object
            properties:
              array1:
                type: array
                items:
                  type: string

              array2:
                type: array
                items:
                  type: object
                  properties:
                    str:
                      type: string

              array3:
                type: array
                items:
                  type: object
                  title: InlineObject
                  properties:
                    str:
                      type: string

              array4:
                type: array
                items:
                  $ref: "#/definitions/DefinedObject"

definitions:
  DefinedObject:
    type: object
    properties:
      str:
        type: string

Currently ReDoc displays:
array1 . . . . Array of string
array2 . . . object
array3 . . . InlineObject
array4 . . . DefinedObject

It seems like this would be better:
array1 . . . . Array of string
array2 . . . Array of object
array3 . . . Array of InlineObject
array4 . . . Array of DefinedObject

Thank you for all your hard work and help!

bug

All 4 comments

@dwilding thanks for the detailed report. Will try to fix for the next release

array4 scenario stopped working since v2.0.0-alpha.6. Seems fine on alpha.5

All of these appear as "Array of object" for me... Seems weird.

Running v2.0.0-alpha.17.

I loaded up my original test spec in v2.0.0-alpha.17. I'm seeing:
array1 . . . . Array of string
array2 . . . Array of object
array3 . . . Array of object
array4 . . . Array of object

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gauravmokhasi picture gauravmokhasi  路  4Comments

ahshum picture ahshum  路  3Comments

shreyas-agnihotri picture shreyas-agnihotri  路  3Comments

raderio picture raderio  路  4Comments

skllcrn picture skllcrn  路  3Comments