awrb commented on code in PR #992:
URL: https://github.com/apache/cxf/pull/992#discussion_r950907477
##########
rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUiConfig.java:
##########
@@ -260,6 +261,10 @@ public SwaggerUiConfig tryItOutEnabled(boolean tryItOut) {
}
public Boolean isQueryConfigEnabled() {
+ if (!Boolean.TRUE.equals(queryConfigEnabled) &&
!getConfigParameters().isEmpty()) {
Review Comment:
Good point @reta, where do you think is the best place to modify it
implicitly? The other place I put the modification was in
`getConfigParameters()`, but it's also a kind of getter (just an aggregative
one) and you probably wouldn't expect it to modify fields. An alternative would
be in each setter (other than `setQueryConfigEnabled`), but the drawback would
be some repetition, e.g:
```
public void setUrl(final String url) {
this.url = url;
setQueryConfigEnabledIfNecessary();
}
public void setMaxDisplayedTags(Integer maxDisplayedTags) {
this.maxDisplayedTags = maxDisplayedTags;
setQueryConfigEnabledIfNecessary();
}
private void setQueryConfigEnabledIfNecessary() {
// perhaps also check if a sensible, non-blank value was set?
if (this.queryConfigEnabled == null) {
setQueryConfigEnabled(true);
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]