Skip to content

chore(catalog): rename getById to getCollectionSchema - #69

Merged
mborne merged 2 commits into
mainfrom
68-get-collection-schema
Jul 17, 2026
Merged

mborne merged 2 commits into
mainfrom
68-get-collection-schema

Conversation

@mborne

@mborne mborne commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

This pull request refactors the CollectionCatalog interface and related classes to rename the method getById to getCollectionSchema. This change improves clarity by making the method's purpose more explicit. The update is applied consistently across the implementation, interface, tests, and documentation.

API Naming Improvements:

  • Renamed the getById method to getCollectionSchema in the CollectionCatalog interface (src/catalog/types.ts) and its implementation in InMemoryCollectionCatalog (src/catalog/in-memory.ts). [1] [2]
  • Updated all usages of getById to getCollectionSchema in tests (test/unit/catalog/in-memory.test.ts, test/unit/index.test.ts) and documentation (README.md).

(closes #68 )

@mborne mborne self-assigned this Jul 17, 2026
@mborne
mborne requested a review from Copilot July 17, 2026 09:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors the catalog public API to use a clearer method name (getCollectionSchema) instead of getById, aligning the name with the returned data (collection schema) and the documented HTTP endpoint shape.

Changes:

  • Renamed CollectionCatalog.getById to CollectionCatalog.getCollectionSchema in the public interface and InMemoryCollectionCatalog implementation.
  • Updated unit tests to call getCollectionSchema instead of getById.
  • Updated README usage example to the new method name.

Reviewed changes

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

Show a summary per file
File Description
test/unit/index.test.ts Updates catalog API usage in the public entry-point unit test.
test/unit/catalog/in-memory.test.ts Updates in-memory catalog unit tests to the renamed method.
src/catalog/types.ts Renames the method on the exported CollectionCatalog interface.
src/catalog/in-memory.ts Renames the method on the in-memory implementation to match the interface.
README.md Updates documentation example to use the new API name.

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

Comment thread test/unit/catalog/in-memory.test.ts Outdated
Comment thread src/catalog/types.ts
Comment thread src/catalog/in-memory.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mborne
mborne merged commit 8e8a9e0 into main Jul 17, 2026
3 checks passed
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.

Public API - catalog - rename getById to getCollectionSchema

2 participants