-
Notifications
You must be signed in to change notification settings - Fork 26.6k
fix:openapi #15806
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.3
Are you sure you want to change the base?
fix:openapi #15806
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 3.3 #15806 +/- ##
============================================
- Coverage 60.75% 60.72% -0.04%
- Complexity 11695 11700 +5
============================================
Files 1938 1938
Lines 88679 88752 +73
Branches 13386 13403 +17
============================================
+ Hits 53877 53892 +15
- Misses 29270 29326 +56
- Partials 5532 5534 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@heliang666s PTAL |
| schema.setDeprecated(anno.deprecated() ? Boolean.TRUE : null); | ||
|
|
||
| return chain.resolve(parameter, context); | ||
| return schema; |
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.
Why remove it?
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.
Because it has already been called once here, if it is called again, it will be called twice. So I directly returned the schema. I believe the schema annotation is failing because it's being called an extra time at the end, which prevents the preceding set methods from taking effect.
@oxsean
Summary
Fix two critical issues in Dubbo REST OpenAPI schema resolution for generic nested types:
Generic nested type resolution incomplete - Schemas for intermediate generic types (e.g.,
PageResponseinApiResponse<PageResponse<AccessLogRes>>) were completely missingAnnotated fields disappearing or losing annotation metadata - Fields with
@Schemaannotations were filtered out, anddescription/exampleproperties were not displayedBefore Fix
{ "AccessLogRes": { "properties": { "userId": { "type": "string" }, "createTime": { "format": "date-time", "type": "string" } } } }Missing
idandactionfieldsNo description or example in any field
After Fix
{ "AccessLogRes": { "properties": { "id": { "type": "string", "description": "操作ID", "example": "123456" }, "userId": { "type": "string" }, "action": { "type": "string", "description": "操作类型", "example": "LOGIN" }, "createTime": { "format": "date-time", "type": "string" } } } }All 4 fields present
Annotation metadata (description, example) properly displayed
Related Issues
#15718