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

feat(java): deserialize oneof #492

Merged
merged 2 commits into from
May 11, 2022
Merged

feat(java): deserialize oneof #492

merged 2 commits into from
May 11, 2022

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented May 11, 2022

🧭 What and Why

The deserialization part of one of was not implemented at all, because it's a complicated challenge.
For now it will try to deserialize into every type and returns the first one that matches, which is less than ideal because some type are compatible with others.

The best way to do it would be with some kind of discriminator (available in openapi) but this would only work on object.

🧪 Test

Use the playground with something that returns a oneOf, like analytics.getTopSearches

@millotp millotp self-assigned this May 11, 2022
@netlify
Copy link

netlify bot commented May 11, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit 4ab7605
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/627b9fe4e13f330008bd1610

@algolia-bot
Copy link
Collaborator

algolia-bot commented May 11, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.

@millotp millotp force-pushed the feat/java-deserialize-oneof branch from e9d56d5 to e25ed4a Compare May 11, 2022 10:00
@millotp millotp requested review from a team, eunjae-lee and damcou and removed request for a team May 11, 2022 10:01
@millotp millotp force-pushed the feat/java-deserialize-oneof branch from e25ed4a to 4ab7605 Compare May 11, 2022 11:37
@@ -32,21 +32,21 @@ runs:

# JavaScript utils
- name: client-javascript-utils-client-common
if: ${{ inputs.type == 'all' || inputs.type == 'js_utils' }}
if: ${{ (inputs.javascript == 'true' && inputs.type == 'all') || inputs.type == 'js_utils' }}
Copy link
Member

Choose a reason for hiding this comment

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

nice

@millotp millotp merged commit e86e870 into main May 11, 2022
@millotp millotp deleted the feat/java-deserialize-oneof branch May 11, 2022 11:57
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