You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because calling JsonSchemaConfig.builder() automatically sets the SubclassesResolver(null) and which in turn trigger the entire classpath scan to build class graph, such
public SubclassesResolver(ClassGraph classGraph) {
if (classGraph == null) {
log.debug("Entire classpath will be scanned because SubclassesResolver is not configured. See https://github.com/mbknor/mbknor-jackson-jsonSchema#subclass-resolving-using-reflection");
classGraph = new ClassGraph();
}
this.scanResult = classGraph.enableClassInfo().scan();
}
This is prob the side effect on generated code from scala to java - but I haven't dig deeper
This takes up a lot of memory and is a waste of resources esp. if we are specifying the packages/classes to scan. In the code below, we are already scanning the entire classpath at JsonSchemaConfig.builder() before setting limiting the packages to scan subclassesResolver(..) e.g
val config = JsonSchemaConfig.builder()
.subclassesResolver(SubclassesResolver(listOf(ENTITY_PACKAGES_TO_SCAN), listOf()))
.....
.build()```
The text was updated successfully, but these errors were encountered:
stellalie
changed the title
Calling JsonSchemaConfig.builder() scan the entire classpath
Calling JsonSchemaConfig.builder() scans the entire classpath
May 25, 2023
This is because calling
JsonSchemaConfig.builder()
automatically sets theSubclassesResolver(null)
and which in turn trigger the entire classpath scan to build class graph, suchThis is prob the side effect on generated code from scala to java - but I haven't dig deeper
This takes up a lot of memory and is a waste of resources esp. if we are specifying the packages/classes to scan. In the code below, we are already scanning the entire classpath at
JsonSchemaConfig.builder()
before setting limiting the packages to scansubclassesResolver(..)
e.gThe text was updated successfully, but these errors were encountered: