OpenAPI: auto-add-tags feature uses superclass/interface name, rather than actual class name
See original GitHub issueDescribe the bug
Consider the following:
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface AbstractReadOnlyResource<T> {
@GET
@Path("/{id}")
T getById(@PathParam("id") long id);
}
and
@Path("/address")
public class AddressResource implements AbstractReadOnlyResource<Address> {
@Override
public Address getById(long id) {
// Removed for brevity
}
}
Expected behavior
The get
operation of the /address/{id}
path is tagged with Address Resource
.
Actual behavior
The resource is tagged with Abstract Read Only Resource
.
OpenAPI JSON contains
"paths" : {
"/address/{id}" : {
"get" : {
"tags" : [ "Abstract Read Only Resource" ],
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
}
} ],
}
}
}
Swagger UI shows:
How to Reproduce?
~Will add a link to a GitHub repo shortly.~
EDIT: A small reproducer project can be found here.
Output of uname -a
or ver
Linux jbe-desktop 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version “11.0.11” 2021-04-20
GraalVM version (if different from Java)
none
Quarkus version or git rev
2.4.0.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Using OpenAPI and Swagger UI - Quarkus
This will automatically add tags to operations based on the Java class name. Environment variable: QUARKUS_SMALLRYE_OPENAPI_AUTO_ADD_TAGS. Show more.
Read more >Swagger different classes in different namespaces with same ...
I got (more than) two Api POST endpoints. Each one needs a json as parameter. But when I use the same class name...
Read more >OpenAPI Specification - Version 3.0.3 - Swagger
An OpenAPI definition can then be used by documentation generation tools to display the API, ... All field names in the specification are...
Read more >Usage - OpenAPI Generator
The meta command creates a new Java class and template files, used for creating your own custom templates. openapi-generator-cli help meta. NAME.
Read more >OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
All field names in the specification are case sensitive. ... feature, this section describes requests initiated other than by an API call, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @MikeEdgar !
@phillip-kruger that is excellent news! thank you very much, looking forward to the release 😄