Closed AlexFalappa closed 3 years ago
Having a look at Spring Boot documentation on typesafe configuration properties I might suggest to try in AbstractSwaggerUiConfigProperties
class:
protected final SyntaxHighlight syntaxHighlight = new SyntaxHighlight() ;
instead of
protected SyntaxHighlight syntaxHighlight;
and to remove the setter public void setSyntaxHighlight(SyntaxHighlight syntaxHighlight)
.
Maybe the processor navigates the oject hierarchy only if they are instanced.
Made a quick PR #949 for you to try.
Made trough GitHub web interface, did not build the project myself.
Noticed that the Csrf
object in SwaggerUiConfigProperties
is indeed instantiated and the csrf
subproperties correctly extracted by the spring configuration processor.
You may want to apply the same pattern there too, that is private final Csrf csrf= new Csrf()
and no setter public void setCsrf(Csrf csrf)
: it makes more clear that the inner object is fixed and only its properties are intended to be modified.
While editing an
application.properties
file in an IDE I noticed thatspringdoc.swagger-ui.syntax
gets completed intospringdoc.swagger-ui.syntax-highlight
but this is not enough it should proposespringdoc.swagger-ui.syntax-highlight.theme
andspringdoc.swagger-ui.syntax-highlight.activate
.Infact the configuration properties metadata extracted by Spring Boot configuration processor is incomplete. I checked
META-INF/spring-configuration-metadata.json
inspringdoc-openapi-common-1.5.0.jar
and it contains only:The configuration properties class
org.springdoc.core.AbstractSwaggerUiConfigProperties
seems correct and the configuration processor should extract the metadata fromorg.springdoc.core.AbstractSwaggerUiConfigProperties$SyntaxHighlight
inner class.It would be useful to see why configuration metadata for the inner
SyntaxHighlight
class is not extracted.