You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
all of those could be LLM prompts but some of them are better solved heuristically
figure out that is the endpoint entity (ie. issue) and locate it the response data type
used to name resource/table
figure out if the endpoint returns a single entity or a list of entities
well constructed endpoint path will contain path param at the end for "details" type of endpoint returning single entity
has a list as a response or a list under a well known key (then returns a list)
figure out unique id/primary key of the entity
if a list type
4. figure out pagination
one of 4 most common paginators
identify pagination params to remove them from resource signature
we are able to figure out header and json/cursor based pagination from the response structure and header information
in worst case we can autodetect paginators from the data at runtime
figure out if endpoint supports incremental loading
figure out cursor field (ie. updated_at)
before and since parameters
figure out if we should generate a transformer
details type
6a. a "details" type may be a transformer.
identify parent resource (possibly by matching paths)
match path param and response field (possibly primary key) to bind transformer to incoming data from parent
6b. list type
they may be standalone resources (ie. issues in a repo) or a transformers (when connected to a parent ie. to a list of repo in organization)
see 5a.
also code generation should allow to create a resource and a transformer
Info Discovery
To fully convert endpoint to resource we need to figure out as follows (assuming that this is REST Api that has any semblance to what REST Api should be: https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/)
all of those could be LLM prompts but some of them are better solved heuristically
if a list type
4. figure out pagination
updated_at
)before
andsince
parametersdetails type
6a. a "details" type may be a transformer.
6b. list type
they may be standalone resources (ie. issues in a repo) or a transformers (when connected to a parent ie. to a list of repo in organization)
Representation
Discovery results should be passed to the code generation level. We have an idea to save it as https://github.com/dlt-hub/verified-sources/blob/enh/api_helper/sources/rest_api/typing.py#L107 and let people tweak it so it is easy to re-generate the code (ie. by chaning the paginator type or fixing transformer settings)
The text was updated successfully, but these errors were encountered: