kontent-ai / kontent-ai/java-packages

Add support for items-feed endpoint

Open
#84 1 comment 0 reactions 0 assignees View on GitHub
enhancement hacktoberfest
Dominant language
Java
Stars
17
Forks
27
PR merge metrics
No merged PRs in 30d

Description

### Motivation

Allow developers to fetch all content item variants from the new `\items-feed` endpoint. This offers developers a way to export an entire project no matter the size.

### Proposed solution

The content is is provided in small chunks together with a continuation token for the next chunk. The continuation token is sent in `X-Continuation` header both for request and response. Should the response from Delivery API contain the token, there are additional items to fetch. If the request does not contain the continuation header, Delivery API will return the first chunk.
Filtering parameters are same as for `items` endpoint but _paging_ and _depth_ are not supported.
The response has also the similar structure to `items` endpoint but _paging_ object is missing and `modular_content` contains only components.

**Implementation details for consistency:** _(name casing should be adapted according to the rest of SDK)_
Add a new method to `DeliveryClient` with a name `GetItemsFeed()`. The method should support the same filtering parameters as `GetItems()` except for _depth_, _skip_ and _limit_ and return a content items variants feed.
The feed contains a bool property `HasMoreResults` that is true if the first batch was not yet fetched or there are more items to fetch (indicated by a continuation header in the previous response). The feed also contains a method `FetchNextBatch()` that would retrieve the next response from `\items-feed` endpoint.

### Additional context

See [.NET SDK](https://github.com/Kentico/kontent-delivery-sdk-net/pull/166) for reference code

Contributor guide

Open the contributing guide

Research direction

Start with the existing DeliveryClient.GetItems() behavior and the response models used for the items endpoint, then compare the .NET SDK reference linked in the issue. Implement support for the items-feed endpoint with its filtering parameters and X-Continuation request/response handling. Done means the feed exposes HasMoreResults and FetchNextBatch(), while excluding depth, skip, limit, paging, and modular-content items other than components.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.