-
Notifications
You must be signed in to change notification settings - Fork 91
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
JDK classes should also be scanned if required #1999
Comments
I just tested 4.0.0, since this is one of the things that was fixed. However, I can't get it to work. I removed the temporary solution from #1995 and added <includeStandardJavaModules>
<includeStandardJavaModule>java.base</includeStandardJavaModule>
</includeStandardJavaModules> Testing with some dummy endpoints: @GET
@Path("foo")
@Produces(MediaType.TEXT_PLAIN)
public Response foo(@QueryParam("timeunit") final TimeUnit timeunit) {
return Response.ok("foo").build();
}
@GET
@Path("bar/{timeunit}")
@Produces(MediaType.TEXT_PLAIN)
public Response bar(@PathParam("timeunit") final TimeUnit timeunit) {
return Response.ok("bar").build();
} I get the following in "/api/dummy/foo" : {
"get" : {
"parameters" : [ {
"name" : "timeunit",
"in" : "query",
"schema" : {
"type" : "object"
}
} ],
"responses" : {
"200" : {
"description" : "OK"
}
}
}
},
"/api/dummy/bar/{timeunit}" : {
"get" : {
"parameters" : [ {
"name" : "timeunit",
"in" : "path",
"required" : true,
"schema" : {
"type" : "object"
}
} ],
"responses" : {
"200" : {
"description" : "OK"
}
}
}
} What am I doing wrong? Also, it would be great to have the configuration documented on https://github.com/smallrye/smallrye-open-api/tree/main/tools/maven-plugin This is what I see in the Maven console:
|
If you run the plugin with |
I see the following:
Note that we're in the midst of migrating from JDK 8 to JDK 17. This means that we're running the build under JDK 17, but compiling for target Java 8.
|
What properties are you providing for these? <scanExcludePackages>${openapi.exclude.packages}</scanExcludePackages>
<scanExcludeClasses>${openapi.exclude.classes}</scanExcludeClasses> |
Some internal packages and classes, and then But I also see the following in the scanner log:
|
Are you using regex, or simply comma-separated packages/classes? I'm curious if somehow |
Well, here's the Maven debugging output, I'm not using regexes:
|
Ok, the presence of |
This is from the specification [1], which might help how you set these include/exclude options:
|
Ah, I wasn't aware of that, thanks! I now removed |
Started by #1995
The Maven plugin doesn't scan any JDK classes. We use
TimeUnit
in some REST endpoints, and while there is a workaround for that (thanks @MikeEdgar), it's cumbersome.So I suggest an enhancement: Either there should be a flag to enable JDK class scanning or there should be a plugin property where a number of JDK classes can be listed to be scanned.
Since the first solution would probably make scanning slower, I suggest implementing the second solution - thanks!
The text was updated successfully, but these errors were encountered: