Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate pagination object #170

Closed
kimlundjohansen opened this issue Jan 12, 2023 · 1 comment
Closed

Unable to generate pagination object #170

kimlundjohansen opened this issue Jan 12, 2023 · 1 comment

Comments

@kimlundjohansen
Copy link
Contributor

kimlundjohansen commented Jan 12, 2023

Describe the bug
Cannot generate result type of pagination with a generic result type.

To Reproduce
Spec:

`openapi: 3.0.1
info:
title: API
description: API
version: v1
contact:
name: Company
license:
name: MIT
servers:

  • url: /api/v1
    description: Api version 1.0
    tags:
  • name: Software
    description: ''
    paths:
    /products:
    parameters:
    • name: customerId
      in: header
      required: false
      schema:
      type: string
      format: uuid
      get:
      summary: Retrieve all products
      description: Retrieve all products
      operationId: listProducts
      parameters:
      • $ref: '#/components/parameters/pagingPageSize'
      • $ref: '#/components/parameters/pagingPageIndex'
        responses:
        '200':
        description: OK
        content:
        application/json:
        schema:
        allOf:
        - $ref: "#/components/schemas/Pagination"
        - type: object
        properties:
        results:
        type: array
        items:
        $ref: "#/components/schemas/Product"
        components:
        parameters:
        continuationToken:
        name: continuationToken
        in: query
        required: false
        schema:
        type: string
        nullable: true
        description: The continuation token.
        opcUaUrl:
        name: opcUaUrl
        in: query
        required: true
        schema:
        type: string
        pagingPageSize:
        name: pageSize
        in: query
        required: true
        schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
        description: The numbers of items to return.
        pagingPageIndex:
        name: pageIndex
        in: query
        required: false
        schema:
        type: integer
        minimum: 0
        default: 0
        description: The number of items to skip before starting to collect the result set.
        password:
        name: password
        in: query
        required: false
        schema:
        type: string
        userName:
        name: userName
        in: query
        required: false
        schema:
        type: string
        schemas:
        Pagination:
        type: object
        title: Pagination
        description: An item result subset of a data query.
        properties:
        pageSize:
        type: number
        description: The number of items to request.
        pageIndex:
        type: number
        nullable: true
        description: The given page index starting with 0.
        queryString:
        type: string
        nullable: true
        description: The query to filter items by.
        continuationToken:
        type: string
        nullable: true
        description: Token to indicate next result set.
        count:
        type: number
        description: Items count in result set.
        totalCount:
        type: number
        nullable: true
        description: Total items count.
        totalPages:
        type: number
        nullable: true
        description: Total pages.
        results:
        type: array
        items: {}
        required:
      • pageSize
      • count
        Product:
        title: Product
        type: object
        required:
      • id
      • entityId
      • version
        properties:
        id:
        type: string
        format: uuid
        entityId:
        type: string
        version:
        type: integer
        format: int64
        requestBodies: {}
        responses: {}
        `
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants