Skip to content

refactor(specs): add interface to manipulate query parameter between composition API & Search API #5123

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

Merged
merged 2 commits into from
Jul 21, 2025

Conversation

ClaraMuller
Copy link
Contributor

@ClaraMuller ClaraMuller commented Jul 16, 2025

🧭 What and Why

🎟 JIRA Ticket: Work preparation for https://algolia.atlassian.net/browse/CMP-484

Composition API team is preparing update of the API clients with writes endpoints (see full list of endpoints here).
Goals of this PR is to cleanup / refactor the current Open API spec to ease the integrations of the new endpoints.

Changes included:

  1. Interface for Search parameters

Create directory specs/composition-full/common/params with the files:

  • Search.yml: dedicated to link toward the actual spec for Search API specs as the same parameters are expected to be used
  • Composition.yml to store query parameter dedicated to Composition API that might differs from the Search API ones

File specs/composition-full/common/params/Search.yml allow to have a simple interface to always refer to in the spec for Composition API.
This file is responsible to maintain the link between the Comp API specs and the Search API specs (see next step for handling code duplication) to avoid all the other parts of the Comp API specs to have to do it.

This file allow to refer every parameter for files specs/composition-full/common/schemas/components/Injection.yml & specs/composition-full/common/schemas/requestBodies/RunParams.yml to refer to directly

  1. Clarify parameters allowed for injection behaviour

Simplify file specs/composition-full/common/schemas/components/Injection.yml to have a better view of what parameter is allowed where.

Stack PRs

Next steps

Mutualise code between Search API Client and Composition API client regarding query parameters.
Some are not yet exported to be referenced directly.

🧪 Test

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

@algolia-bot
Copy link
Collaborator

algolia-bot commented Jul 16, 2025

✔️ Code generated!

Name Link
🪓 Triggered by 6ed2cbe352df972fdd30206f49042c325a327ba0
🍃 Generated commit 07e3f5245b19f806a4edb0b3ecfc1cb8cef2515f
🌲 Generated branch generated/clara/refact/add-params-interface
📊 Benchmark results

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

Language Req/s
go 1757
javascript 1643
php 1465
csharp 1230
java 1078
python 1054
ruby 839
swift 633
scala 23

@ClaraMuller ClaraMuller force-pushed the clara/refact/group-files-in-dir branch from 3902472 to 14f3cbc Compare July 16, 2025 13:10
@ClaraMuller ClaraMuller force-pushed the clara/refact/add-params-interface branch from 1b16d2c to a561559 Compare July 16, 2025 13:19
Base automatically changed from clara/refact/group-files-in-dir to main July 16, 2025 13:55
@ClaraMuller ClaraMuller force-pushed the clara/refact/add-params-interface branch from a561559 to 825c35d Compare July 16, 2025 16:24
@ClaraMuller ClaraMuller marked this pull request as ready for review July 16, 2025 16:26
@ClaraMuller ClaraMuller requested a review from a team as a code owner July 16, 2025 16:26
@ClaraMuller ClaraMuller requested review from morganleroi, Fluf22 and a team July 16, 2025 16:26
@@ -0,0 +1,565 @@
advancedSyntax:
Copy link
Member

Choose a reason for hiding this comment

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

this is the same as the index settings one, no? if so, we can import it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code duplication is legacy, check my next PR to see the final results

type: array
items:
$ref: '../../../common/schemas/IndexSettings.yml#/advancedSyntaxFeatures'
description: |
Copy link
Member

Choose a reason for hiding this comment

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

same here the description is the same, is there a reason to duplicate it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code duplication is legacy, check my next PR to see the final results

@ClaraMuller ClaraMuller force-pushed the clara/refact/add-params-interface branch from 825c35d to aec0c49 Compare July 18, 2025 08:28
@ClaraMuller
Copy link
Contributor Author

After rebasing, I have an error on the Dart client, happy to have insights about how to fix it.

@shortcuts
Copy link
Member

seems to work locally after yarn cli generate dart, will re-run

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.

gg

@shortcuts shortcuts merged commit 84a1f4e into main Jul 21, 2025
54 of 56 checks passed
@shortcuts shortcuts deleted the clara/refact/add-params-interface branch July 21, 2025 07:01
algolia-bot added a commit that referenced this pull request Jul 21, 2025
…composition API & Search API (#5123) (generated) [skip ci]

Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-csharp that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-dart that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-go that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-java that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-kotlin that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-php that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-python that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-ruby that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-scala that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
algolia-bot added a commit to algolia/algoliasearch-client-swift that referenced this pull request Jul 21, 2025
…composition API & Search API (generated)

algolia/api-clients-automation#5123

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clara Muller <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
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