Skip to content

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

Merged
millotp merged 1 commit into
mainfrom
clara/feat/enrich-list-composition-endpoint
May 5, 2025
Merged

feat(specs): enrich response for list composition endpoint#4819
millotp merged 1 commit into
mainfrom
clara/feat/enrich-list-composition-endpoint

Conversation

@ClaraMuller

@ClaraMuller ClaraMuller commented May 5, 2025

Copy link
Copy Markdown
Contributor

🧭 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

algolia-bot commented May 5, 2025

Copy link
Copy Markdown
Contributor

✔️ 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

@Fluf22 Fluf22 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@millotp millotp 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.

thanks ! Is this ready to be merged ?

@ClaraMuller

Copy link
Copy Markdown
Contributor Author

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

@millotp

millotp commented May 5, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

millotp commented May 5, 2025

Copy link
Copy Markdown
Contributor

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
…enerated) [skip ci]

Co-authored-by: Clara Muller <5667350+ClaraMuller@users.noreply.github.com>
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request May 5, 2025
algolia/api-clients-automation#4819

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Clara Muller <5667350+ClaraMuller@users.noreply.github.com>
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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