Skip to content

Commit

Permalink
Merge pull request #41979 from radcortez/fix-41892
Browse files Browse the repository at this point in the history
Override items from super classes when generating config documentation
  • Loading branch information
radcortez authored Jul 22, 2024
2 parents 885372b + 4a88da1 commit 65e7336
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,19 @@ private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String r
configDocKey.setJavaDocSiteLink(getJavaDocSiteLink(type));
ConfigDocItem configDocItem = new ConfigDocItem();
configDocItem.setConfigDocKey(configDocKey);

// If there is already a config item with the same key it comes from a super type, and we need to override it
ConfigDocItem parent = null;
for (ConfigDocItem docItem : configDocItems) {
if (docItem.getConfigDocKey().getKey().equals(configDocKey.getKey())) {
parent = docItem;
break;
}
}
// We may want to merge the metadata, but let's keep this simple for now
if (parent != null) {
configDocItems.remove(parent);
}
configDocItems.add(configDocItem);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import java.util.Optional;
import java.util.OptionalInt;

import io.quarkus.runtime.annotations.ConfigGroup;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;

@ConfigGroup
public interface OtlpExporterConfig {
String DEFAULT_GRPC_BASE_URI = "http://localhost:4317/";
String DEFAULT_HTTP_BASE_URI = "http://localhost:4318/";
Expand Down

0 comments on commit 65e7336

Please sign in to comment.