Toggle is a hypermedia control pattern that presents a bi-value, such as on/off or true/false, and offers an affordance to toggle that value from its current state to the opposite state. The Toggle pattern has a Toggle resource that contains the value to toggle. An Action resource toggles the value when triggered. The Action returns a
Location header pointing back to the modified Toggle resource.
A Data resource that contains the value being toggled. This value can be a field in the data object, or it can be a single value. A Toggle resource can have multiple Togglers, one per field. The links may contain an anchor property indicating the field to be toggled.
Points to the Toggle resource that will be toggled. The anchor value in the link contains a path to the field being toggled, if relevant.
Web Link Context (anchor): RFC 8288, section 3.2
Copyright © 2019, 2020, 2021 Matt Bishop
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.