docs.konghq.com
docs.konghq.com copied to clipboard
List all services on the Kong Admin API spec claims to return a single service
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