tryAGI / tryAGI/AutoSDK

Generate operation-specific async pagination from response links

Open
#387 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
92
Forks
8
Avg merge
1d 6h
Merged PRs (30d)
4

Description

Summary

AutoSDK's --generate-pageable-helpers emits useful generic pager primitives, including the same-origin-safe NextUrlAsync, but it does not connect those primitives to generated operations. Consumers still have to repeat fetch/extract lambdas and manually thread every original query parameter.

Apple's App Store Connect OpenAPI spec exposes a broad, consistent JSON:API collection shape with:

  • a data array;
  • links.next URLs;
  • limit-based collection operations;
  • hundreds of generated collection methods.

This is a strong first-class input from which AutoSDK can generate ergonomic, typed IAsyncEnumerable<T> operation helpers.

Requested behavior

When an operation's response schema has an identifiable item collection plus a next URL/cursor/page token:

  • generate an operation-specific async enumerable helper;
  • preserve the original operation's filter/include/fields parameters;
  • carry cancellation through every page request;
  • stop on null/repeated next values;
  • reuse the existing same-origin protection before following absolute next URLs;
  • avoid buffering all pages;
  • remain trim/AOT-safe.

The same inference should cover common OpenAPI-described shapes such as JSON:API links.next, cursor fields, and explicit next-page tokens. Vendor extensions can supplement inference where the schema is ambiguous.

Acceptance criteria

  • Add an App Store Connect-style JSON:API fixture.
  • Generate a typed all-items helper for a collection operation with filters.
  • Verify multiple pages, cancellation, repeated-next termination, and cross-origin rejection.
  • Do not generate a helper when the item or continuation shape is ambiguous.
  • Document the detected pagination shapes and any opt-out/override mechanism.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generator path behind --generate-pageable-helpers and the existing NextUrlAsync primitive. Add the App Store Connect-style JSON:API fixture, then exercise a filtered collection operation across multiple pages, cancellation, repeated next values, and cross-origin rejection. Done means typed helpers are generated only for unambiguous continuation shapes and the detected shapes and overrides are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
api, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.