Skip to content

chore(test): check that the response can contain unknown field #4805

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 10 commits into from
May 13, 2025

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented May 2, 2025

🧭 What and Why

Add a test that assert that unknown fields doesn't make the deserialization fail, at the root of the object, or nested in a oneOf inside an array inside a object.

@millotp millotp self-assigned this May 2, 2025
@algolia-bot
Copy link
Collaborator

algolia-bot commented May 2, 2025

✔️ Code generated!

Name Link
🪓 Triggered by 4fb8b777957a568b0eb7d3647208a38fc82617ad
🍃 Generated commit 8f70154d0b46f7db68be6af7ad7b1f489351aed5
🌲 Generated branch generated/chore/test-deser
📊 Benchmark results

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

Language Req/s
go 1686
javascript 1673
php 1503
csharp 1324
java 1119
python 1059
ruby 825
swift 376
scala 23

@millotp millotp marked this pull request as ready for review May 6, 2025 11:20
@millotp millotp requested a review from a team as a code owner May 6, 2025 11:20
@millotp millotp requested review from morganleroi and shortcuts May 6, 2025 11:20
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.

idk about the swift part but the rest looks wonderful


// languages that just put the response in a map, there is no strict parsing or types to match.
const isLaxLanguage = (lang: string) => {
return lang === 'dart' || lang === 'javascript' || lang === 'python' || lang === 'php';
Copy link
Member

Choose a reason for hiding this comment

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

can this be moved as an option in the tests field of the clients config? I tried to update some scripts to remove those inline conditions where possible, having the json schema there as well helps us better describing things

@millotp millotp enabled auto-merge (squash) May 13, 2025 11:04
@millotp millotp merged commit 1e2d00e into main May 13, 2025
28 checks passed
@millotp millotp deleted the chore/test-deser branch May 13, 2025 11:10
algolia-bot added a commit that referenced this pull request May 13, 2025
algolia-bot added a commit to algolia/algoliasearch-client-go that referenced this pull request May 13, 2025
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