Skip to content

KTOR-9451 Support nested generic types#5500

Draft
bjhham wants to merge 1 commit intorelease/3.xfrom
bjhham/nested-generics-schema
Draft

KTOR-9451 Support nested generic types#5500
bjhham wants to merge 1 commit intorelease/3.xfrom
bjhham/nested-generics-schema

Conversation

@bjhham
Copy link
Copy Markdown
Contributor

@bjhham bjhham commented Mar 31, 2026

Subsystem
Server, OpenAPI (Schema)

Motivation
KTOR-9451 OpenAPI schema inference not working for custom nested generics

Solution
We were previously only checking if the supplied KType was parameterized, but this logic doesn't work for multiple levels of generics. To account for this, we need to initially traverse the type argument tree to populate a lookup of KTypes, because the generated serializers' descriptors have no way of introspecting on this.

Additionally, I noticed that generics were only supported for collection types on the reflection schema inference side, so I also fixed this.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 79bb553a-1a4c-477e-a2ab-f1652a857790

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bjhham/nested-generics-schema

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bjhham bjhham force-pushed the bjhham/nested-generics-schema branch from e7592de to 75a8e65 Compare March 31, 2026 07:20
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