Skip to content

Conversation

@vnikolova
Copy link
Collaborator

KTOR-9255

Add a new section in the OpenAPI spec gen topic for Schema inference. Mention how to use annotations and reflection-based schema inference when using Jackson and Gson.

@vnikolova vnikolova requested a review from bjhham January 21, 2026 14:49
@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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.

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
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vnikolova/KTOR-9255

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.

Copy link
Contributor

@bjhham bjhham left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, I forgot to hit the button 🥲

Comment on lines 256 to 266
### Customize schemas with annotations

You can override automatically generated JSON schema fields by adding annotations to your data classes:

```kotlin
@JsonSchema.Description("Represents a news article")
data class Article(
val title: String,
val content: String
)
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify that we're referring to these annotations?

https://github.com/ktorio/ktor/blob/4d77c04170812d69c57845a4ce7272f199f29730/ktor-shared/ktor-openapi-schema/common/src/io/ktor/openapi/JsonSchema.kt#L131

Maybe it would be good to link to the KDocs for the full list of options.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea - added a link to the API docs.

@vnikolova vnikolova requested a review from bjhham February 10, 2026 17:06
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