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

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

Open
2 tasks done
jmadureira opened this issue Dec 9, 2024 · 0 comments
Open
2 tasks done

Comments

@jmadureira
Copy link

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

  • I agree to follow this project's Code of Conduct
  • I agree to abide by the Community Expectations
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

1 participant