docs.konghq.com icon indicating copy to clipboard operation
docs.konghq.com copied to clipboard

List all services on the Kong Admin API spec claims to return a single service

Open jmadureira opened this issue 1 year ago • 0 comments

Where is the problem?

https://docs.konghq.com/gateway/api/admin-oss/latest/#/Services/list-service

What happened?

The OpenAPI spec for the (list services endpoint)[https://docs.konghq.com/gateway/api/admin-oss/latest/#/Services/list-service] claims that the endpoint returns a single Service instance when in fact returns a list of services.

The root cause is defined on the spec itself

/services:
    get:
      description: List all services
      operationId: list-service
      parameters:
        - $ref: '#/components/parameters/pagination-size'
        - $ref: '#/components/parameters/pagination-offset'
        - $ref: '#/components/parameters/pagination-tags-filter'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Service'
            application/xml:
              schema:
                type: object
                properties: {}
          description: A successful response listing services
        '401': 
          $ref: '#/components/responses/HTTP401Error'
      summary: List all services
      tags:
        - Services

What did you expect to happen?

The spec should indicate that the endpoint return a list of services. Something along these lines:

/services:
    get:
      description: List all services
      operationId: list-service
      parameters:
        - $ref: '#/components/parameters/pagination-size'
        - $ref: '#/components/parameters/pagination-offset'
        - $ref: '#/components/parameters/pagination-tags-filter'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/Service'
                      type: array
                  offset:
                    $ref: '#/components/schemas/pagination-offset-response'
            application/xml:
              schema:
                type: object
                properties: {}
          description: A successful response listing services
        '401': 
          $ref: '#/components/responses/HTTP401Error'
      summary: List all services
      tags:
        - Services

Code of Conduct and Community Expectations

  • [X] I agree to follow this project's Code of Conduct
  • [X] I agree to abide by the Community Expectations

jmadureira avatar Dec 09 '24 16:12 jmadureira