-
Notifications
You must be signed in to change notification settings - Fork 1.2k
KTOR-9293 Add empty summary default for operations #5338
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: main
Are you sure you want to change the base?
Conversation
WalkthroughChanges to how empty and null summaries are handled in OpenAPI operations. Operation.Builder.summary default changed from null to empty string, merging logic updated to prefer non-empty summaries, and test assertion added to verify empty string output. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
| * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.openapi.Operation.Builder.summary) | ||
| */ | ||
| public var summary: String? = null | ||
| public var summary: 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.
Can we make it non-nullable?
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.
That would be a breaking change 😞
|
Looks like |
|
Yeah it seems that the empty string uncovered a bug in the YAML parser. It creates something like: Then interpreting |
Subsystem
Server, Swagger
Motivation
KTOR-9293 OpenAPI describe needs defaults
The Swagger front-end breaks when Operation is an empty object.
Solution
Added an empty string summary for the
Operationtype.