Skip to content

Conversation

yshrsmz
Copy link

@yshrsmz yshrsmz commented Aug 19, 2025

related: #14301, #21531

This is essentially a successor of #21531.
I've added discriminator support for kotlin-client multiplatform, as asked in https://github.com/OpenAPITools/openapi-generator/pull/21531/files?w=1#r2276511440.

  • added a missing multiplatform check in KotlinClientCodegen#postProcessAllModels(Map)
  • updated related templates.
  • added kotlin-multiplatform-allOf-discriminator

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

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • 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.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@wing328
Copy link
Member

wing328 commented Aug 28, 2025

please review the build failure when you've time

@yshrsmz
Copy link
Author

yshrsmz commented Aug 28, 2025

@wing328 thanks, fixed the issue. At least my local bash bin/generate-samples.sh shows no diff.

@wing328
Copy link
Member

wing328 commented Aug 28, 2025

@yshrsmz
Copy link
Author

yshrsmz commented Aug 29, 2025

@wing328 yes it was caused by this PR, but said samples/client/petstore/kotlin-multiplatform-allOf-discriminator/gradlew is actually committed here: https://github.com/OpenAPITools/openapi-generator/pull/21772/files#diff-892a177c01f704378fb7dc7c996b85d4d1b0678807bb609e240c08f60d7972ba

@yshrsmz
Copy link
Author

yshrsmz commented Aug 29, 2025

@wing328

ok found the problem. I named the sample project kotlin-multiplatform-allOff-discriminator(allOff), but tried to reference that project as kotlin-multiplatform-allOf-discriminator(allOf).

While I think it should be allOf, I discovered that the existing samples like kotlin-allOff-discriminator or kotlin-allOff-discriminator-kotlinx-serialization use allOff.

Should I follow existing convention or use allOf?

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.

2 participants