-
Notifications
You must be signed in to change notification settings - Fork 7
[SABRA-2456] Add V2 Facets and Searchabilities API Support #237
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
base: master
Are you sure you want to change the base?
Conversation
Code Review Results✅ StrengthsWell-structured implementation with comprehensive test coverage for V2 Facets and Searchabilities APIs, maintaining backwards compatibility with V1 methods while properly handling camelCase/snake_case conversions. 🚨 Critical IssuesNone
|
Code Review ResultsStrengthsThis PR adds well-structured V2 endpoints for Facets and Searchabilities with comprehensive test coverage, proper TypeScript types, and backward compatibility support for snake_case parameters. Critical IssuesNone identified. The implementation is solid and ready to merge. Important IssuesTest File IssuesFile: spec/src/modules/catalog/catalog-facet-configurations-v2.js Line: 69
File: spec/src/modules/catalog/catalog-facet-configurations-v2.js Line: 78-165
Implementation IssuesFile: src/modules/catalog.js Line: 3704, 3914, 3989, 4049, 4228, 4370, 4502
File: src/modules/catalog.js Line: 4355
TypeScript Type IssuesFile: src/types/catalog.d.ts Line: 727, 759
SuggestionsFile: spec/src/modules/catalog/catalog-facet-configurations-v2.js Line: 26-35
File: src/modules/catalog.js Line: 3577-3579, 3631-3633
File: spec/src/modules/catalog/catalog-facet-configurations-v2.js Line: 103-120
File: src/modules/catalog.js Line: 4106-4124
General
Overall Assessment: Pass This is high-quality work with excellent test coverage and proper implementation. The V2 APIs are well-designed with backward compatibility support. The few issues identified are minor and the suggestions are for code quality improvements rather than functional problems. The PR is ready to merge after addressing the test cleanup inconsistency if desired. |
Add V2 Facets and Searchabilities API Support
Summary
This PR adds support for the V2 versions of the
/v2/facetsand/v2/searchabilitiesendpoints, running in parallel with the existing V1 implementations.Changes
New Facets V2 Methods
addFacetConfigurationV2- Create a single facet configurationgetFacetConfigurationsV2- Retrieve all facet configurations with paginationgetFacetConfigurationV2- Get a specific facet by namemodifyFacetConfigurationsV2- Batch partial update facets (PATCH)modifyFacetConfigurationV2- Partially update a single facetreplaceFacetConfigurationV2- Replace a single facet configuration (PUT)createOrReplaceFacetConfigurationsV2- Batch create or replace facets (PUT)removeFacetConfigurationV2- Delete a facet configurationNew Searchabilities V2 Methods
retrieveSearchabilitiesV2- Retrieve searchabilities with filtering/pagination/sortinggetSearchabilityV2- Get a specific searchability by namepatchSearchabilitiesV2- Batch create or update searchabilitiespatchSearchabilityV2- Update a single searchabilitydeleteSearchabilitiesV2- Batch delete searchabilitiesdeleteSearchabilityV2- Delete a single searchabilityNew Types (TypeScript)
FacetConfigurationV2- V2 facet model withpathInMetadatafieldSearchabilityConfigurationV2- V2 searchability model with new fields (displayable,hidden,createdAt,updatedAt)V2 API Differences from V1
Facets:
pathInMetadatafield which specifies where in item metadata the facet data is located/v2/facetsendpoint instead of/v1/facetsSearchabilities:
displayableandhiddenfieldscreatedAt/updatedAttimestamps/v2/searchabilitiesendpoint instead of/v1/searchabilitiesTest Plan
catalog-facet-configurations-v2.jswith comprehensive test coverage for all facet V2 operationscatalog-searchabilities-v2.jswith comprehensive test coverage for all searchability V2 operationsafterhooksBreaking Changes
None. V2 methods are additive and V1 methods remain unchanged.