-2

I'm working in a nodeJS project with express framework, i am using swagger-jsdoc and swagger-ui-express, also i'm writing my configuration in yaml file. I want to documents my services but i have some problems when i try to display nested objects. Simply, i cant see nothins when i expand the tree of nested objects. Please help.

[Swagger definition][1]
[My yaml file][2]
[Result in browser][3]

[1]: https://i.stack.imgur.com/by9EU.png
[2]: https://i.stack.imgur.com/KMyXN.png
[3]: https://i.stack.imgur.com/OHwlt.png
Paul R.
  • 1
  • 1

1 Answers1

0

A property whose value is an instance of another object is defined like this:

components:
  schemas:
    ...
    BuilderElementRequest:
      type: object
      properties:

        pageSectionElementRequest:
          $ref: '#/components/schemas/PageSectionElementRequest'   # <---------

        removedElements:
          type: array
          items:
            type: string

To add a custom example (i.e. override the default example) for a referenced schema in OpenAPI 3.0.x, you need to wrap the $ref into allOf:

        pageSectionElementRequest:
          allOf:
            - $ref: '#/components/schemas/PageSectionElementRequest'
          example:
            element: '11112'
Helen
  • 87,344
  • 17
  • 243
  • 314