Link

Editable List Pattern

Editabe List expands the List pattern by adding editing controls. An editable list pattern may not enable all editing controls. An editable list can choose to omit a control, like Add Entry, in favour of another approach that is more intuitive to the semantics of the list.

This diagram includes the existing List resources List and Entry and adds additional relationships to new resources to make it an editable list. The List resource’s profiles includes both the editable/list-resource profile and the base list-resource profile.

The Entry resource in the diagram is unchanged from the base list’s Entry and has no extension profile.

List Resource

Profile: <http://level3.rest/patterns/list/editable#list-resource>

The Editable List resource inherits the base List resource’s profile requirements.

empty-list

rel="http://level3.rest/patterns/list/editable#empty-list"

Leads to an Empty List action that empties the List when triggered.

add-entry

rel="http://level3.rest/patterns/list/editable#add-entry"

Points to an Add Entry resource that adds an entry to the list. This relationship is optional and may be implemented with a more semantic relationship like “add-to-basket” on a product in a shopping API or “add-to-team” on a player profile in a fantasy sports league API.

Empty List Resource

Profile: <http://level3.rest/patterns/list/editable#empty-list-resource>

Action resource that empties the List. Triggering the action returns a Location pointing to the list.

empties-list

rel="http://level3.rest/patterns/list/editable#empties-list"

Links to the List that is emptied by this action.

Add Entry Resource

Profile: <http://level3.rest/patterns/list/editable#add-entry-resource>

Add Entry resource adds an Entry to the list. The profile is undefined, but it is often a Form resource.

adds-to-list

rel="http://level3.rest/patterns/list/editable#adds-to-list"

Links to the List into which the Add Entry resource adds entries.


Copyright © 2019 Matt Bishop
Creative Commons Licence
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.