Skip to content

Return lookup results as arrays#12

Merged
shuchenliu merged 3 commits intomainfrom
fix-return-shape
May 8, 2026
Merged

Return lookup results as arrays#12
shuchenliu merged 3 commits intomainfrom
fix-return-shape

Conversation

@shuchenliu
Copy link
Copy Markdown
Member

Solving #10

The /lookup and /bulk-lookup endpoints now match the response shape used by Solr CI.

Copy link
Copy Markdown

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

Updates the NameResolution API /lookup and /bulk-lookup responses to return lookup results as arrays (to match the Solr CI response shape) and adjusts the integration contract tests accordingly.

Changes:

  • Change /lookup to return a JSON array of result objects instead of a CURIE-keyed dictionary.
  • Add a finish_json helper to safely return top-level JSON lists from Tornado handlers.
  • Update API contract tests to assert list-shaped lookup results (including /bulk-lookup values).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/nameres/handlers/lookup.py Switches lookup result aggregation to a list and updates handler response writing.
src/nameres/handlers/base.py Adds finish_json() to emit JSON for top-level list responses.
test/test_api_contract.py Updates contract expectations from dict-shaped to list-shaped lookup results.

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

Comment thread src/nameres/handlers/lookup.py Outdated
Comment thread src/nameres/handlers/lookup.py Outdated
Comment thread src/nameres/handlers/lookup.py
Copy link
Copy Markdown

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

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

Comment thread src/nameres/handlers/lookup.py Outdated
Copy link
Copy Markdown

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@shuchenliu shuchenliu merged commit 96c4d47 into main May 8, 2026
4 checks passed
@shuchenliu shuchenliu deleted the fix-return-shape branch May 8, 2026 21:59
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.

2 participants