All Questions
Api Design medium

A client calls GET /orders/123 and needs the customer object embedded. The API supports field expansion. How is this requested?

  1. A Include a query parameter such as ?expand=customer or ?include=customer to tell the server to inline the related resource object.
  2. B Use a hierarchical URL structure like /orders/123/customer to explicitly request the sub-resource as a standalone representation.
  3. C Configure the server's default serialization settings to always include all nested relationships within every GET request for the resource.
  4. D Define a custom media type in the Accept header that signals the server to return a 'verbose' version of the response with all fields populated.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions