Skip to content

[kotlin][client] Fix Parcelable oneOf/anyOf sealed interfaces with kotlinx_serialization - #24687

Merged
4brunu merged 3 commits into
OpenAPITools:masterfrom
4brunu:fix/kotlin-oneof-anyof-parcelable
Aug 12, 2026
Merged

[kotlin][client] Fix Parcelable oneOf/anyOf sealed interfaces with kotlinx_serialization#24687
4brunu merged 3 commits into
OpenAPITools:masterfrom
4brunu:fix/kotlin-oneof-anyof-parcelable

Conversation

@4brunu

@4brunu 4brunu commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) @stefankoppier (2022/06) @e5l (2024/10)


Summary by cubic

Fixes Parcelable generation for Kotlin oneOf/anyOf sealed interfaces with kotlinx_serialization. Unions now implement Parcelable, and wrapper value classes are @Parcelize, resolving Android parcelization and compile issues.

  • Bug Fixes
    • For parcelizeModels with kotlinx_serialization, generate sealed interface … : Parcelable for oneOf/anyOf unions.
    • Add @Parcelize to each inline wrapper value class inside the union.
    • Skip top-level @Parcelize on the interface when using kotlinx_serialization to avoid conflicts.

Written for commit 036b653. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle Outdated
… with kotlinx_serialization"

This reverts commit 6276a05.
@4brunu
4brunu merged commit f56f55d into OpenAPITools:master Aug 12, 2026
15 checks passed
@4brunu
4brunu deleted the fix/kotlin-oneof-anyof-parcelable branch August 12, 2026 10:56
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.

1 participant