How do I represent a request as an array in Dev Portal Smart Docs?

It appears that Smart docs does not render a request which is an array correctly.

It works in Spec editor for "named objects" in example.

7323-speceditor-array.png

However, in Smart Docs it does not

7324-smartdoc-array.png

The test yaml is:

swagger: '2.0'
info:
  description: |
    Simple objects in array test
  version: Two-point-Oh!
  title: Simple objects in array test
paths:
  /test:
    post:
      summary: Array with named objects
      description: Array with named objects
      parameters:
        - in: body
          name: param1
          description: test param1
          required: true
          schema:
            type: array
            items:
              $ref: '#/definitions/stackoverflow'
      responses:
        '200':
          description: OK
  /test2:
    post:
      summary: Array with simpel (nameless) objects
      description: Array with simpel (nameless)  objects
      parameters:
        - in: body
          name: param1
          description: test param1
          required: true
          schema:
            $ref: '#/definitions/stackoverflow2'
      responses:
        '200':
          description: OK
definitions:
  stackoverflow:
    type: object
    properties:
      name:
        type: string
        description: name of the object
  stackoverflow2:
    type: array
    items:
      $ref: '#/definitions/stackoverflow2_inner'
  stackoverflow2_inner:
    properties:
      name:
        type: string
        description: name of the object
0 5 472
5 REPLIES 5

Kurt, You may need to dig into the smartdocs js to see what it does with a Model of this type. Sometimes the fix is relatively easy to spot.

Hello,

I dug through the Smart Docs JS to determine how the model type was being handled per the suggestion above. I found within the SwaggerModel that the JS does not appear to be reviewing the type listed with the model. I did find that the types associated with the properties in model are being considered in SwaggerModelProperty function. I am little puzzled as to why the model's type is not being considered before generating the JSON. I am wondering if I missed the code piece where the model type is reviewed?

Thank you

@Kurt Googler Kanaskie : Hope you are doing well :).

Were you able to figure out how to show array in SmartDocs.

@Pradeep Ande, I am doing well, hope you are too!

Not yet, but a bug has been reported and I've added this link to it, so I'll update when things change.

@Kurt Googler Kanaskie: Any update on the bug about showing Array in SmartDocs.