Skip to content

Misusing openApi spec for generic pagination #111

@MogensFogh

Description

@MogensFogh

Describe the bug
This is the recommendation from the demo project for adding pagination.

                allOf:
                  - $ref: '#/components/schemas/Pagination'
                  - $ref: '#/components/schemas/Orders'

Where Orders is an array with ref to the Order class.
It generates a return value of Pagination and not a combination of Pagination and Orders.

Spec should specify property items:

                allOf:
                  - $ref: '#/components/schemas/Pagination'
                  - type: object
                    required:
                      - items
                    properties:
                      items:
                        type: array
                        items:
                          - $ref: '#/components/schemas/Order'

To Reproduce
Steps to reproduce the behavior:

  1. Add Pagination to yaml spec
  2. Use other tool to generate client

Expected behavior
Expect that the spec represent the generated api.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions