Skip to content

Conversation

ClaraMuller
Copy link
Contributor

🧭 What and Why

What

This PR refactors the Composition API client specs to introduce a dedicated Search.yml file that aggregates all Search API resource references.
Composition API should continue to expose resources from other clients as we plan to grow in API you can directly call. Having a clear separation of concern will make the evolution of the Composition API client easier.

Why

  • Avoids duplicating direct $ref calls to Search API schemas in multiple files (all parameter that are shared between run and injection: filters, hitsPerPage, etc...).
  • Simplifies maintenance: future updates to Search API specs can be managed in one place.
  • Makes the dependency between Composition and Search explicit and easier to track.

Changes included:

  • Created a new file specs/composition-full/common/params/Search.yml containing all Search API–related $ref definitions used in Composition.
  • Updated Injection.yml and RunParams.yml to reference this new file instead of directly pointing to common/schemas/IndexSettings.yml, common/schemas/SearchParams.yml (the difference means nothing for Composition API) or complexe one like common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/facets
  • This change is a refactor only, no functional behavior is altered.

🧪 Test

  • CI
  • Locally run
    • yarn cli build specs all
    • yarn cli build clients javascript

@ClaraMuller ClaraMuller requested a review from a team as a code owner August 26, 2025 11:22
@algolia-bot
Copy link
Collaborator

algolia-bot commented Aug 26, 2025

No code generated

If you believe code should've been generated, please, report the issue.

📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
go 1793
javascript 1620
php 1456
csharp 1360
python 1168
java 959
ruby 838
swift 402
scala 23

@ClaraMuller
Copy link
Contributor Author

ClaraMuller commented Aug 26, 2025

This PR is basically the revert of this commit: c004dd2 from this merged PR #5125.

I saw there was question about it but I wanted to re-open the conversation as I believe this change make sense in a context of maintainability in the futur.

@ClaraMuller ClaraMuller requested a review from a team August 26, 2025 11:25
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

nitpick comment, looks good

Comment on lines 42 to 45
enableRules:
$ref: '../../params/Composition.yml#/enableRules'
ruleContexts:
$ref: '../../params/Composition.yml#/ruleContexts'
Copy link
Member

Choose a reason for hiding this comment

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

should those, that are initially search parameters, but edited to match composition's requirement, also moved to that new Search.yml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As they are not related anymore to Search API client, I don't believe so.
The Search.yml file also contains the ref to the actual search query paramter that we used in other part of the composition API clients.
For these query paramater. available for run request for Composition, we want them to point to Composition specific parameters

Copy link
Member

Choose a reason for hiding this comment

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

fine for me

@shortcuts shortcuts enabled auto-merge (squash) August 29, 2025 12:21
@shortcuts shortcuts merged commit 3703081 into main Aug 29, 2025
29 checks passed
@shortcuts shortcuts deleted the clara/refact/add-search-interface branch August 29, 2025 12:32
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