Skip to content

apiVersion/kind exist on top-level REST responses (GET/LIST, WATCH events), but not on individual items within a LIST response #3030

Description

@abonas

'kind' property exists only on the outer entity in REST api hence providing not aligned behavior for REST api consumers.
Example: when querying for all services (/api/v1beta1/services) there's an attribute
"kind": "ServiceList" on the collection, but in the "items" section with the actual services - none of the services has the "kind" attribute.
But when querying for a specific service, for example:
http://localhost:8080/api/v1beta1/services/kubernetes-ro
There is a "kind": "Service" on the entity.

I don't see the necessity to have the "kind" property in the first place since the user knows which resource was called by the api specific url, but even if it has a reason and is by design, the entities attributes should be identical whether retrieved as a single entity or as a collection. Otherwise the client should be adding/deleting attributes when retrieved as a collection by their collection type - which is doable, but definitely not elegant.
In other words, either "kind" should be present in each entity when retrieved in bulk AND when retrieved as a single entity, or not present at all for all cases.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/apiIndicates an issue on api area.area/usabilitylifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/backlogHigher priority than priority/awaiting-more-evidence.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

  • Status
    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions