Skip to content

Conversation

@abubnalitic-nbl
Copy link
Contributor

No description provided.

… paginated response structure instead of returning the full '{count, next, previous, results}' dict as it is not equipped for pagination
@abubnalitic-nbl abubnalitic-nbl self-assigned this Oct 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where netbox_search_objects was returning NetBox's full paginated API response structure (containing count, next, previous, and results fields) instead of just the results array. The function now correctly extracts the results array from the response.

Key changes:

  • Modified netbox_search_objects to extract the results array from NetBox's paginated response structure
  • Updated all test mocks to return the correct paginated response format matching NetBox API behavior
  • Added comprehensive test case to verify proper extraction of results from paginated responses

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
server.py Updated netbox_search_objects to extract results array from paginated API response using response.get("results", [])
tests/test_search.py Updated all mock responses to return realistic paginated response structure and added new test case validating results extraction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ltucker ltucker changed the title fix: netbox_serach_objects now extracts 'results' array from NetBox's paginated response structure instead of returning the full '{count, next, previous, results}' dict as it is not equipped for pagination fix: netbox_search_objects now extracts 'results' array from NetBox's paginated response structure instead of returning the full '{count, next, previous, results}' dict as it is not equipped for pagination Oct 27, 2025
@abubnalitic-nbl abubnalitic-nbl merged commit dd7c4d2 into main Oct 27, 2025
2 checks passed
@abubnalitic-nbl abubnalitic-nbl deleted the fix/search-pagination branch October 27, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants