Skip to content

feat(specs): enrich response for list composition endpoint #4819

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 1 commit into from
May 5, 2025

Conversation

ClaraMuller
Copy link
Contributor

@ClaraMuller ClaraMuller commented May 5, 2025

🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/CMP-424

Changes included:

  • List changes

List composition endpoint response is enriched with response fields added since:

🧪 Test

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

@algolia-bot
Copy link
Collaborator

algolia-bot commented May 5, 2025

✔️ Code generated!

Name Link
🪓 Triggered by c650ff89b85964c912b737eeb3e0be1c616ced93
🍃 Generated commit c0d35ef741680e92cefde15ecdc801c1ae5634b3
🌲 Generated branch generated/clara/feat/enrich-list-composition-endpoint
📊 Benchmark results

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

Language Req/s
javascript 1662
php 1533
go 1500
csharp 1346
java 1102
python 1016
ruby 814
swift 775
scala 23

@ClaraMuller ClaraMuller changed the title feat(composition): enrich response for list composition endpoint feat(specs): enrich response for list composition endpoint May 5, 2025
@ClaraMuller ClaraMuller marked this pull request as ready for review May 5, 2025 14:13
@ClaraMuller ClaraMuller requested a review from a team as a code owner May 5, 2025 14:13
@ClaraMuller ClaraMuller requested review from Fluf22 and millotp May 5, 2025 14:13
@ClaraMuller ClaraMuller force-pushed the clara/feat/enrich-list-composition-endpoint branch from 7d7aff0 to 3d9fb97 Compare May 5, 2025 14:15
Copy link
Contributor

@Fluf22 Fluf22 left a comment

Choose a reason for hiding this comment

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

Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

thanks ! Is this ready to be merged ?

@ClaraMuller
Copy link
Contributor Author

@millotp Sorry I just rebased as Github was complaining about not being up to date with main

@millotp
Copy link
Collaborator

millotp commented May 5, 2025

Sorry I just rebased as Github was complaining about not being up to date with main

no worries, this is required because the CI will push a generated commit once this is merged

@millotp millotp enabled auto-merge (squash) May 5, 2025 14:22
@ClaraMuller
Copy link
Contributor Author

Ok I see. I checked if I have to generate other stuff please do not hesitate if some stuff are missing in this PR 🙏

@millotp
Copy link
Collaborator

millotp commented May 5, 2025

I think this is all good 😄

@ClaraMuller ClaraMuller requested a review from e-krebs May 5, 2025 14:29
@millotp millotp merged commit d26cbaa into main May 5, 2025
29 checks passed
@millotp millotp deleted the clara/feat/enrich-list-composition-endpoint branch May 5, 2025 14:30
algolia-bot added a commit that referenced this pull request May 5, 2025
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request May 5, 2025
Comment on lines +14 to +25
page:
type: integer
description: Current page.
example: 0
hitsPerPage:
type: integer
description: Number of items per page.
example: 20
nbHits:
type: integer
description: Number of items.
example: 200
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit late to the party, but shouldn't those be required as they are always returned @ClaraMuller ?
cc: @millotp

Copy link
Contributor

Choose a reason for hiding this comment

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

(the Typescript types generated by the CI are optional which made me realize)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What would happen if the field are not in the response (for whatever reason, for example due to a bug).
I would have though that by default no fields is required in the response to prevent having issue in the client side if something is going wrong in the backend.
But I don't have a strong opinion, I will update if we think this is important.

Copy link
Contributor

Choose a reason for hiding this comment

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

What would happen if the field are not in the response (for whatever reason, for example due to a bug).

There would be an error because we wouldn't handle it.
But if there's a bug in the backend, that's fine imho.

The specs should represent the expected shape of data when there is no bug.
Otherwise it's unmanageable on the frontend to handle all cases when all data is optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will make them required then.

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.

5 participants