Skip to content
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

fix(specs): correctly pass searchParams to the request #531

Merged
merged 4 commits into from
May 23, 2022

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented May 20, 2022

🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-496

Changes included:

Fixes #528

This PR solves two problem of the generated clients:

  1. The facet/hits queries are not differentiated
  2. The params parameters should be sent as a string (serialized) and not as an object

1

This endpoint accepts both facet and hits queries, which have distinct options while having some in common. We now provide a precise allOf/oneOf to properly describe its usage.

2

As the API accepts both params parameter and root level parameters, we now only leverage the root level parameters to prevent any extra logic

Next

Documentation will be added via https://algolia.atlassian.net/browse/APIC-484

🧪 Test

CI :D

@shortcuts shortcuts self-assigned this May 20, 2022
@netlify
Copy link

netlify bot commented May 20, 2022

Deploy Preview for api-clients-automation ready!

Name Link
🔨 Latest commit b420fc5
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/628b90d2767138000870437a
😎 Deploy Preview https://deploy-preview-531--api-clients-automation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@algolia-bot
Copy link
Collaborator

algolia-bot commented May 20, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

@shortcuts shortcuts requested review from a team, damcou, millotp and Haroenv and removed request for a team May 23, 2022 09:06
@shortcuts shortcuts marked this pull request as ready for review May 23, 2022 09:07
Haroenv
Haroenv previously approved these changes May 23, 2022
@shortcuts shortcuts requested review from eunjae-lee and removed request for damcou May 23, 2022 09:30
millotp
millotp previously approved these changes May 23, 2022
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.

Nice ! Subtle but deadly type, it would be nice to have model extends in java but that's a bonus

specs/search/common/schemas/SearchQuery.yml Show resolved Hide resolved
Comment on lines +49 to +59
searchTypeFacet:
type: string
enum: [facet]
default: facet
description: Perform a search query with `default`, will search for facet values if `facet` is given.

searchTypeDefault:
type: string
enum: [default]
default: default
description: Perform a search query with `default`, will search for facet values if `facet` is given.
Copy link
Collaborator

Choose a reason for hiding this comment

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

could this be the same enum but with a different default value ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean allowing both? It made the type to complicate to predict so I had to duplicate it

Copy link
Contributor

Choose a reason for hiding this comment

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

you can't mix the type actually, if you're in a facet "query" you can't use the default type, so separate or literal "default" | "facet" is the only option I think

@shortcuts shortcuts merged commit b8e6be7 into main May 23, 2022
@shortcuts shortcuts deleted the fix/specs-search-request branch May 23, 2022 14:04
@shortcuts shortcuts mentioned this pull request May 23, 2022
3 tasks
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.

client.search should take parameters as object, but send as string
4 participants