Enable abbreviated API responses e.g. for populating form fields #2487
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Environment
Proposed Functionality
Enable abbreviated output when a particular parameter (e.g.
?brief=1
) is passed with an API request. For example,GET /api/dcim/devices/
returns a full representation of each device in the list,GET /api/dcim/devices/?brief=1
would return only the integer ID and a text representation of each device.Use Case
The REST API uses serializers to return NetBox resources as JSON objects. The API output includes all resource attributes, and often includes nested representation of related resources. This can be inefficient when the API output is used for tasks where only a basic representation of each object is required; for example, when populating a
<select>
widget within an HTML form.Database Changes
None
External Dependencies
None
The text was updated successfully, but these errors were encountered: