-
Notifications
You must be signed in to change notification settings - Fork 363
KTOR-9255 Docs for JSON schema inference #752
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
base: 3.4.0
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
bjhham
left a comment
There was a problem hiding this 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 🥲
| ### 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 | ||
| ) | ||
| ``` |
There was a problem hiding this comment.
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?
Maybe it would be good to link to the KDocs for the full list of options.
There was a problem hiding this comment.
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.
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.