Skip to main content

IPA-124: Repeated Fields

Providing clients with lists of data can be complex. Aligning on a single strategy for providing clients with repeated fields allows the complexity to be reduced when clients need to modify the lists.

State

Adopt

Guidance

  • Repeated fields must use a plural field name
  • Repeated fields should have an enforced upper bound that will not cause a single resource payload to become too large
    • A good rule of thumb is 100 elements
    • If repeated data has the chance of being too large, the API should use a sub-resource instead

Update Strategy

  • A resource may use one of two strategies to enable updating a repeated field:
    • Direct update using the standard Update method
      • A standard Update method is only able to update the entire list
    • Custom Add and Remove methods
note

Declarative-friendly resources must use the standard Update method, and not introduce Add and Remove methods. To learn more, see IPA-127.