ppetzold / nestjs-paginate

Pagination and filtering helper method for TypeORM repositories or query builders using Nest.js framework :book::paperclip:
MIT License
429 stars 93 forks source link

Problem with openapi generator #976

Open benjaminfrancois opened 2 weeks ago

benjaminfrancois commented 2 weeks ago

Hello,

I'm using this library for the first time, and it works great! However, I've generated TypeScript Axios services for the frontend using OpenAPI Generator, and all the responses are wrapped in the PaginatedDocumented interface. I would like to retrieve the actual interface that is correctly defined in the Swagger, but it seems to be nested within a secondary object.

"responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/PaginatedDocumented"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Organization"
                          }
                        },
                        "meta": {
                          "properties": {
                            "select": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "id",
                                  "name",
                                  "siret",
                                  "archivedAt",
                                  "createdAt",
                                  "updatedAt"
                                ]
                              }
                            },

I use :


  @ApiOkPaginatedResponse(Organization, ORGANIZATION_PAGINATE_OPTIONS)
  @ApiPaginationQuery(ORGANIZATION_PAGINATE_OPTIONS)

Thank's !

Helveg commented 1 day ago

Hi there, thanks for the report! Could you show both the current output, and the expected output? I believe it may be similar to what someone else was reporting here, but the author did not follow up further.