apache / apache/dubbo

[Bug] dubbo-rest-openapiin Dubbo 3.3.5: PageResponseand AccessLogResClass Structures Missing from Generated JSON and @SchemaAnnotations Ineffective

Open
#15,718 2 comments 0 reactions 1 assignee Claimed by @heliang666s View on GitHub
type/bug
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

### Pre-check

- [x] I am sure that all the content I provide is in English.

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.

### Apache Dubbo Component

Java SDK (apache/dubbo)

### Dubbo Version

dubbo 3.3.5 jdk21

### Steps to reproduce this issue

When using Dubbo version 3.3.5 with the dubbo-rest-openapimodule, the generated OpenAPI JSON documentation does not include the schema definitions for the PageResponseand AccessLogResclasses used in the response type ApiResponse>. Additionally, the io.swagger.v3.oas.annotations.media.Schemaannotations appear to have no effect on the generated documentation.
This issue hinders the proper generation of API documentation and may affect service consumers who rely on accurate OpenAPI specs.

### What you expected to happen

Based on your description, I'll help you create an issue template for Dubbo regarding the problem where PageResponseand AccessLogResclass structures are missing from the generated JSON, and @Schemaannotations aren't working with dubbo-rest-openapiin version 3.3.5. You can directly use or adapt this template when submitting the issue to the Dubbo GitHub repository.
​​Title​​: dubbo-rest-openapiin Dubbo 3.3.5: PageResponseand AccessLogResClass Structures Missing from Generated JSON and @SchemaAnnotations Ineffective
​​Problem Description​​:
When using Dubbo version 3.3.5 with the dubbo-rest-openapimodule, the generated OpenAPI JSON documentation does not include the schema definitions for the PageResponseand AccessLogResclasses used in the response type ApiResponse>. Additionally, the io.swagger.v3.oas.annotations.media.Schemaannotations appear to have no effect on the generated documentation.
This issue hinders the proper generation of API documentation and may affect service consumers who rely on accurate OpenAPI specs.
​​Expected Behavior​​:
The generated OpenAPI JSON should correctly include the schema structures for all classes involved in the API response, including PageResponseand AccessLogRes.
The @Schemaannotations should be properly processed and reflected in the generated OpenAPI documentation.
​​Actual Behavior​​:
The schemas for PageResponseand AccessLogResare missing from the generated OpenAPI JSON.
Any @Schemaannotations applied to the models or operations are ignored.
​​Steps to Reproduce​​:
Define a Dubbo service operation that returns ApiResponse>.
Annotate the relevant classes (e.g., PageResponse, AccessLogRes) or fields with io.swagger.v3.oas.annotations.media.Schema.
Configure the application to use dubbo-rest-openapifor generating the OpenAPI documentation (typically accessible via a path like /openapior /v3/api-docs).
Start the application and retrieve the generated OpenAPI JSON.
Observe that the components.schemassection lacks definitions for PageResponseand AccessLogRes, and any applied @Schemaannotations do not affect the output.

### Anything else

_No response_

### Are you willing to submit a pull request to fix on your own?

- [x] Yes I am willing to submit a pull request on my own!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.