From f5d9df9056ec4390951760997b2866f7a1d2d4d9 Mon Sep 17 00:00:00 2001 From: Jose Vitor Schneid Date: Thu, 20 Jul 2023 15:15:58 -0300 Subject: [PATCH] Improve docId getter and documentation (#1872) --- docs/source-1.0/spec/aws/aws-core.rst | 2 +- docs/source-2.0/aws/aws-core.rst | 2 +- .../java/software/amazon/smithy/aws/traits/ServiceTrait.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source-1.0/spec/aws/aws-core.rst b/docs/source-1.0/spec/aws/aws-core.rst index 8ae2c8cf965..c2e84b37611 100644 --- a/docs/source-1.0/spec/aws/aws-core.rst +++ b/docs/source-1.0/spec/aws/aws-core.rst @@ -240,7 +240,7 @@ need to explicitly configure the ``cloudTrailEventSource`` setting. .. _service-doc-id: ``docId`` -=========================== +========= The ``docId`` property is a ``string`` value that is used to implement linking between service and SDK documentation for AWS services. diff --git a/docs/source-2.0/aws/aws-core.rst b/docs/source-2.0/aws/aws-core.rst index 99f6af5db02..2458e2f283f 100644 --- a/docs/source-2.0/aws/aws-core.rst +++ b/docs/source-2.0/aws/aws-core.rst @@ -200,7 +200,7 @@ need to explicitly configure the ``cloudTrailEventSource`` setting. .. _service-doc-id: ``docId`` -=========================== +========= The ``docId`` property is a ``string`` value that is used to implement linking between service and SDK documentation for AWS services. diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ServiceTrait.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ServiceTrait.java index b6f27c09aff..dc539c69a11 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ServiceTrait.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ServiceTrait.java @@ -158,7 +158,7 @@ public String getCloudTrailEventSource() { * @return Returns the documentation identifier value for the service name. */ public String getDocId(Model model) { - return getDocId().orElse(buildDefaultDocId(model)); + return getDocId().orElseGet(() -> buildDefaultDocId(model)); } protected Optional getDocId() {