Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable abbreviated API responses e.g. for populating form fields #2487

Closed
jeremystretch opened this issue Oct 4, 2018 · 0 comments · Fixed by #2488
Closed

Enable abbreviated API responses e.g. for populating form fields #2487

jeremystretch opened this issue Oct 4, 2018 · 0 comments · Fixed by #2488
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@jeremystretch
Copy link
Member

Environment

  • Python version: 3.5.2
  • NetBox version: 2.4.5

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

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application API change labels Oct 4, 2018
jeremystretch added a commit that referenced this issue Oct 4, 2018
jeremystretch added a commit that referenced this issue Oct 4, 2018
Closes #2487: Enable brief API output utilizing nested serializers
jeremystretch added a commit that referenced this issue Oct 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant