Skip to content

Allow specifying the name of the items property for amp-list responses #6507

@dandv

Description

@dandv

Currently, the response from a CORS endpoint supplying data for amp-list must be a JSON object that contains an array property "items".

An unfortunate consequence of this is that a large number of public APIs are unusable, because they dont' return data wrapped in an items array. For example, GitHub's API returns directly an array of objects.

Here's a small amp-list sample trying to show a user's repos: https://jsbin.com/xekavu/edit?html,output

Proposal: add an attribute to amp-list allowing the developer to specify the name of the items property (default "items"):

<amp-list 
    layout=fixed-height
    items=""    
    src="https://api.github.com/users/dandv/repos">

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions