Repository: smithy-lang/smithy
Pull request #2015 (2023-10-21 20:48:35)

Mitigate possible NSE exception in PrivateAccessValidator.java
*Issue #, if available:* n/a

*Description of changes:*

Within `PrivateAccessValidator#getPrivateAccessValiationEvent`, an unchecked call to `Optional#get` occurs. This might throw a `NoSuchElementException` if the optional is indeed empty.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.



Patch:
diff --git a/.github/workflows/sdk-codegen-ci.yml b/.github/workflows/sdk-codegen-ci.yml
index cc8551614..69a29f3d5 100644
--- a/.github/workflows/sdk-codegen-ci.yml
+++ b/.github/workflows/sdk-codegen-ci.yml
@@ -8,7 +8,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - name: Use Node.js 14.x
-        uses: actions/setup-node@v3
+        uses: actions/setup-node@v4
         with:
           node-version: 14.x
 
diff --git a/docs/source-2.0/aws/aws-endpoints-region.rst b/docs/source-2.0/aws/aws-endpoints-region.rst
new file mode 100644
index 000000000..10c0db91f
--- /dev/null
+++ b/docs/source-2.0/aws/aws-endpoints-region.rst
@@ -0,0 +1,414 @@
+.. _aws-endpoints:
+
+===============================
+AWS Declarative Endpoint Traits
+===============================
+
+This document defines AWS declarative endpoint traits.
+
+.. _aws-endpoints-overview:
+
+----------------------
+AWS Endpoints Overview
+----------------------
+
+An endpoint is used to connect programmatically to an AWS service. An endpoint is the URL of the
+entry point for an AWS web service.
+
+Most AWS services are regional: they offer regional endpoints and the service's resources are independent
+of similar resources in other regions.
+
+.. _aws-endpoints-region:
+
+Region
+    Each `region <https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/regions.html>`_
+    consists of multiple availability zones within a single geographic area. Regions themselves are isolated
+    and independent from other regions.
+
+.. _aws-partition:
+
+Partition
+    AWS groups regions into
+    `partitions <https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html>`_.
+    Every region is in exactly one partition and each partition has one or more regions.
+    AWS commercial Regions are in the ``aws`` partition, Regions in China are in the ``aws-cn`` partition,
+    and AWS GovCloud Regions are in the ``aws-us-gov`` partition.
+
+.. _fips-endpoints:
+
+FIPS Endpoints
+    Some AWS services have endpoints that support Federal Information Processing Standard (FIPS) 140-2.
+    For a list of FIPS endpoints, see
+    `FIPS endpoints by Service
+    <http://aws.amazon.com/compliance/fips/#FIPS_Endpoints_by_Service>`_.
+
+.. _dualstack-endpoints:
+
+Dual stack Endpoints
+    Some AWS services offer dual stack endpoints, so that you can access them using either IPv4 or IPv6 requests.
+    For a list of services that support dual stack endpoints, see `AWS services that support IPv6
+    <https://docs.aws.amazon.com/vpc/latest/userguide/aws-ipv6-support.html>`_.
+
+.. smithy-trait:: aws.endpoints#endpointsModifier
+.. _aws.endpoints#endpointsModifier-trait:
+
+-----------------------------------------
+``aws.endpoints#endpointsModifier`` trait
+-----------------------------------------
+
+Summary
+    A meta-trait that marks a trait as an endpoint modifier.  Traits that are marked with this trait are
+    applied to service shapes or operation shapes to indicate how a client can resolve
+    endpoints for that service or operation.
+Trait selector
+    ``[trait|trait]``
+Value type
+    Annotation trait
+
+The following example defines a service with ``standardRegionalEndpoints`` modified by
+the hypothetical ``fooExample`` endpoint modifier.
+
+.. code-block:: smithy
+
+    $version: "2"
+
+    namespace smithy.example
+
+    use aws.endpoints#endpointsModifier
+    use aws.endpoints#standardRegionalEndpoints
+
+    @endpointsModifier
+    @trait(selector: "service")
+    structure fooExample {}
+
+    @standardRegionalEndpoints
+    @fooExample
+    service MyService {
+        version: "2020-04-02"
+    }
+
+Because endpoint modification definitions are just specialized shapes, they
+can also support configuration settings.
+
+.. code-block:: smithy
+
+    $version: "2"
+    namespace smithy.example
+
+    use aws.endpoints#endpointsModifier
+    use aws.endpoints#standardRegionalEndpoints
+
+    @endpointsModifier
+    @trait(selector: "service")
+    structure endpointSuffix {
+        suffix: String
+    }
+
+    @standardRegionalEndpoints
+    @endpointSuffix(suffix="-suffix")
+    service MyService {
+        version: "2020-04-02"
+    }
+
+
+
+.. smithy-trait:: aws.endpoints#standardRegionalEndpoints
+.. _aws.endpoints#standardRegionalEndpoints-trait:
+
+-------------------------------------------------
+``aws.endpoints#standardRegionalEndpoints`` trait
+-------------------------------------------------
+
+Summary
+    An :ref:`endpoints modifier trait <aws.endpoints#endpointsModifier-trait>`
+    that indicates that a service's endpoints should be resolved using the standard AWS regional
+    patterns:
+
+    - Default: ``{service}.{region}.{dnsSuffix}``
+    - Fips: ``{service}-fips.{region}.{dnsSuffix}``
+    - Dualstack: ``{service}.{region}.{dualStackDnsSuffix}``
+    - Fips/Dualstack: ``{service}-fips.{region}.{dualStackDnsSuffix}``
+
+Trait selector
+    ``service``
+Trait value
+    A ``structure`` with the following properties:
+
+.. list-table::
+    :header-rows: 1
+    :widths: 10 30 60
+
+    * - Property
+      - Type
+      - Description
+    * - partitionSpecialCases
+      - ``map`` of partition to `PartitionSpecialCase object`_
+      - A map of partition to partition special cases - endpoints for a partition that do not follow the
+        standard patterns.
+    * - regionSpecialCases
+      - ``map`` of region to `RegionSpecialCase object`_
+      - A map of region to regional special cases - endpoints for a region that do not follow the
+        standard patterns.
+
+Conflicts with
+    :ref:`aws.endpoints#standardPartitionalEndpoints-trait`
+
+Most AWS services are regionalized and are strongly encouraged to follow
+the standard endpoint patterns defined above for consistency, and to
+ensure that endpoints are forwards compatible, and that SDK updates are
+not required when the service launches in a new region or partition.
+
+The following example defines a service that uses the standard regional endpoints:
+
+.. code-block:: smithy
+
+    $version: "2"
+
+    namespace smithy.example
+
+    use aws.endpoints#standardRegionalEndpoints
+
+    @standardRegionalEndpoints
+    service MyService {
+        version: "2020-04-02"
+    }
+
+While services are strongly encouraged to follow standard endpoint patterns,
+there are occasional exceptions and special cases.  The following example defines
+a service that uses standard regional endpoints, but uses a non-standard pattern for
+FIPS endpoints in US GovCloud:
+
+.. code-block:: smithy
+
+    @standardRegionalEndpoints(
+        partitionSpecialCases: {
+            aws-us-gov: [
+                {
+                    endpoint: "myservice.{region}.{dnsSuffix}",
+                    fips: true
+                }
+            ]
+        }
+    )
+    service MyService {
+        version: "2020-04-02"
+    }
+
+``PartitionSpecialCase`` object
+-------------------------------
+
+A ``PartitionSpecialCase`` defines the endpoint pattern to apply for all regional endpoints
+in the given partition. A PartitionSpecialCase object contains the following properties:
+
+.. list-table::
+    :header-rows: 1
+    :widths: 10 30 60
+
+    * - Property name
+      - Type
+      - Description
+    * - endpoint
+      - ``string``
+      - **Required**. The special-cased endpoint template.
+    * - dualStack
+      - ``boolean``
+      - When ``true`` the special case will apply to dualstack endpoint variants.
+    * - fips
+      - ``boolean``
+      - When ``true`` the special case will apply to fips endpoint variants.
+
+
+``RegionSpecialCase`` object
+----------------------------
+
+A ``RegionSpecialCase`` object contains the following properties:
+
+.. list-table::
+    :header-rows: 1
+    :widths: 10 30 60
+
+    * - Property name
+      - Type
+      - Description
+    * - endpoint
+      - ``string``
+      - **Required**. The special-cased endpoint template.
+    * - dualStack
+      - ``boolean``
+      - When ``true`` the special case will apply to dualstack endpoint variants.
+    * - fips
+      - ``boolean``
+      - When ``true`` the special case will apply to fips endpoint variants.
+    * - signingRegion
+      - ``string``
+      - Overrides the signingRegion used for this region.
+
+.. smithy-trait:: aws.endpoints#standardPartitionalEndpoints
+.. _aws.endpoints#standardPartitionalEndpoints-trait:
+
+----------------------------------------------------
+``aws.endpoints#standardPartitionalEndpoints`` trait
+----------------------------------------------------
+
+Summary
+    An :ref:`endpoints modifier trait <aws.endpoints#endpointsModifier-trait>`
+    that indicates that a service is
+    `partitional <https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/global-services.html#global-services-that-are-unique-by-partition>`_
+    and a single endpoint should be resolved per partition.
+Trait selector
+    ``service``
+Trait value
+    A ``structure`` with the following properties:
+
+.. list-table::
+    :header-rows: 1
+    :widths: 10 30 60
+
+    * - Property
+      - Type
+      - Description
+    * - endpointPatternType
+      - ``string``
+      - **Required** The pattern type to use for the partition endpoint.  This value can be set to ``service_dnsSuffix`` to
+        use the ``{service}.{dnsSuffix}`` pattern or ``service_region_dnsSuffix`` to use
+        ``{service}.{region}.{dnsSuffix}``.
+    * - partitionEndpointSpecialCases
+      - ``map`` of partition to `PartitionEndpointSpecialCase object`_
+      - A map of partition to partition endpoint special cases - partitions that do not follow the
+        service's standard patterns or are located in a region other than the partition's
+        ``defaultGlobalRegion``.
+
+Conflicts with
+    :ref:`aws.endpoints#standardRegionalEndpoints-trait`
+
+Partitional services (also known as "global" services) resolve a single endpoint per partition.
+That single endpoint is located in the partition's ``defaultGlobalRegion``. Partitional
+services should follow one of two standard patterns:
+
+- ``service_dnsSuffix``: ``{service}.{dnsSuffix}``
+- ``service_region_dnsSuffix``: ``{service}.{region}.{dnsSuffix}``
+
+The following example defines a partitional service that uses ``{service}.{dnsSuffix}``:
+
+.. code-block:: smithy
+
+    $version: "2"
+
+    namespace smithy.example
+
+    use aws.endpoints#standardPartitionalEndpoints
+
+    @standardPartitionalEndpoints(endpointPatternType: "service_dnsSuffix")
+    service MyService {
+        version: "2020-04-02"
+    }
+
+Services should follow the standard patterns; however, occasionally there are special cases.
+The following example defines a partitional service that uses a special case pattern in
+the ``aws`` partition and uses a non-standard global region in the ``aws-cn`` partition:
+
+.. code-block:: smithy
+
+    @standardPartitionalEndpoints(
+        endpointPatternType: "service_dnsSuffix",
+        partitionEndpointSpecialCases: {
+            aws: [{endpoint: "myservice.global.amazonaws.com"}],
+            aws-cn: [{region: "cn-north-1"}]
+        }
+    )
+    service MyService {
+        version: "2020-04-02"
+    }
+
+``PartitionEndpointSpecialCase`` object
+---------------------------------------
+
+A ``PartitionEndpointSpecialCase`` object contains the following properties:
+
+.. list-table::
+    :header-rows: 1
+    :widths: 10 30 60
+
+    * - Property name
+      - Type
+      - Description
+    * - endpoint
+      - ``string``
+      - The special-cased endpoint template.
+    * - region
+      - ``string``
+      - Override the ``defaultGlobalRegion`` used in this partition.
+    * - dualStack
+      - ``boolean``
+      - When ``true`` the special case will apply to dualstack endpoint variants.
+    * - fips
+      - ``boolean``
+      - When ``true`` the special case will apply to fips endpoint variants.
+
+.. smithy-trait:: aws.endpoints#dualStackOnlyEndpoints
+.. _aws.endpoints#dualStackOnlyEndpoints-trait:
+
+----------------------------------------------
+``aws.endpoints#dualStackOnlyEndpoints`` trait
+----------------------------------------------
+
+Summary
+    An :ref:`endpoints modifier trait <aws.endpoints#endpointsModifier-trait>`
+    that indicates that a service has only
+    `dual stack endpoints <https://docs.aws.amazon.com/general/latest/gr/rande.html#dual-stack-endpoints>`_,
+    does not support IPV4 only endpoints, and should not have the ``useDualStackEndpoint`` endpoint parameter.
+    Dual stack endpoints support IPV4 and IPV6.
+Trait selector
+    ``service``
+Trait value
+    Annotation trait
+
+Adding the ``dualStackOnlyEndpoints`` trait to a service modifies the generation of endpoints from
+:ref:`aws.endpoints#standardRegionalEndpoints-trait` or :ref:`aws.endpoints#standardPartitionalEndpoints-trait`,
+removes the ``useDualStackEndpoint`` parameter, and defaults the behavior to dual stack for
+all partitions that support it.
+
+The following example specifies a service that uses standard regional endpoint patterns and
+is dual stack only:
+
+.. code-block:: smithy
+
+     @standardRegionalEndpoints
+     @dualStackOnlyEndpoints
+     service MyService {
+         version: "2020-04-02"
+     }
+
+.. smithy-trait:: aws.endpoints#rulesBasedEndpoints
+.. _aws.endpoints#rulesBasedEndpoints-trait:
+
+-------------------------------------------
+``aws.endpoints#rulesBasedEndpoints`` trait
+-------------------------------------------
+
+Summary
+    An :ref:`endpoints modifier trait <aws.endpoints#endpointsModifier-trait>`
+    that indicates that a service has hand written endpoint rules.
+Trait selector
+    ``service``
+Trait value
+    Annotation trait
+
+Services marked with the ``rulesBasedEndpoints`` trait have hand written endpoint rules that
+extend or replace their standard generated endpoint rules through an external mechanism.
+This trait marks the presence of hand written rules, which are added to the model by a transformer,
+but does not specify their behavior.
+
+A service with ``rulesBasedEndpoints`` may extend the functionality of
+endpoint behavior described in the model through other
+:ref:`endpoints modifier traits <aws.endpoints#endpointsModifier-trait>`
+by modifying the generated :ref:`EndpointRuleSet <smithy.rules#endpointRuleSet-trait>`.
+The following example specifies a service that has standard regional endpoints extended with hand written rules:
+
+.. code-block:: smithy
+
+     @standardRegionalEndpoints
+     @rulesBasedEndpoints
+     service MyService {
+         version: "2020-04-02"
+     }
diff --git a/docs/source-2.0/aws/index.rst b/docs/source-2.0/aws/index.rst
index d8c49590d..ae9e5711c 100644
--- a/docs/source-2.0/aws/index.rst
+++ b/docs/source-2.0/aws/index.rst
@@ -7,6 +7,7 @@ AWS integrations
 
     aws-core
     aws-auth
+    aws-endpoints-region
     aws-iam
     amazon-apigateway
     aws-cloudformation
diff --git a/smithy-aws-endpoints/src/main/resources/software/amazon/smithy/rulesengine/aws/language/functions/partition/partitions.json b/smithy-aws-endpoints/src/main/resources/software/amazon/smithy/rulesengine/aws/language/functions/partition/partitions.json
index b5f17db83..1910fe30e 100644
--- a/smithy-aws-endpoints/src/main/resources/software/amazon/smithy/rulesengine/aws/language/functions/partition/partitions.json
+++ b/smithy-aws-endpoints/src/main/resources/software/amazon/smithy/rulesengine/aws/language/functions/partition/partitions.json
@@ -105,6 +105,32 @@
         "us-isob-east-1": {},
         "aws-iso-b-global": {}
       }
+    },
+    {
+      "id" : "aws-iso-e",
+      "outputs" : {
+        "dnsSuffix" : "cloud.adc-e.uk",
+        "dualStackDnsSuffix" : "cloud.adc-e.uk",
+        "implicitGlobalRegion" : "eu-isoe-west-1",
+        "name" : "aws-iso-e",
+        "supportsDualStack" : false,
+        "supportsFIPS" : true
+      },
+      "regionRegex" : "^eu\\-isoe\\-\\w+\\-\\d+$",
+      "regions" : { }
+    },
+    {
+      "id" : "aws-iso-f",
+      "outputs" : {
+        "dnsSuffix" : "csp.hci.ic.gov",
+        "dualStackDnsSuffix" : "csp.hci.ic.gov",
+        "implicitGlobalRegion" : "us-isof-south-1",
+        "name" : "aws-iso-f",
+        "supportsDualStack" : false,
+        "supportsFIPS" : true
+      },
+      "regionRegex" : "^us\\-isof\\-\\w+\\-\\d+$",
+      "regions" : { }
     }
   ]
 }
diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryValidator.java
index edd0608a5..20fe3fa0d 100644
--- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryValidator.java
+++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryValidator.java
@@ -42,6 +42,9 @@ import software.amazon.smithy.utils.SmithyInternalApi;
 @SmithyInternalApi
 public final class ClientEndpointDiscoveryValidator extends AbstractValidator {
     private static final Set<String> VALID_INPUT_MEMBERS = SetUtils.of("Operation", "Identifiers");
+    private static final String MISSING_ERROR_DEFINITION = "MissingErrorDefinition";
+    private static final String UNBOUND_OPERATION = "UnboundOperation";
+    private static final String NO_OPERATIONS = "NoOperations";
 
     @Override
     public List<ValidationEvent> validate(Model model) {
@@ -73,7 +76,8 @@ public final class ClientEndpointDiscoveryValidator extends AbstractValidator {
     private List<ValidationEvent> validateTrait(ServiceShape service, ClientEndpointDiscoveryTrait trait) {
         if (!trait.getOptionalError().isPresent()) {
             return ListUtils.of(danger(service, trait,
-                    "Services SHOULD define an error which indicates an endpoint is invalid."));
+                    "Services SHOULD define an error which indicates an endpoint is invalid.",
+                    MISSING_ERROR_DEFINITION));
         }
         return Collections.emptyList();
     }
@@ -86,8 +90,9 @@ public final class ClientEndpointDiscoveryValidator extends AbstractValidator {
                 .filter(pair -> !pair.getKey().getAllOperations().contains(pair.getValue().getOperation()))
                 .map(pair -> error(pair.getKey(), String.format(
                         "The operation `%s` must be bound to the service `%s` to use it as the endpoint operation.",
-                        pair.getValue().getOperation(), pair.getKey()
-                )))
+                        pair.getValue().getOperation(), pair.getKey()),
+                        UNBOUND_OPERATION, pair.getValue().getOperation().getName()
+                ))
                 .collect(Collectors.toList());
 
         validationEvents.addAll(endpointDiscoveryServices.keySet().stream()
@@ -96,8 +101,9 @@ public final class ClientEndpointDiscoveryValidator extends AbstractValidator {
                         "The service `%s` is configured to use endpoint discovery, but has no operations bound with "
                                 + "the `%s` trait.",
                         service.getId().toString(),
-                        ClientDiscoveredEndpointTrait.ID.toString()
-                )))
+                        ClientDiscoveredEndpointTrait.ID.toString()),
+                        NO_OPERATIONS
+                ))
                 .collect(Collectors.toList()));
         return validationEvents;
     }
diff --git a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SmithyIntegration.java b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SmithyIntegration.java
index 5ab5ddad2..a0a5ff9bf 100644
--- a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SmithyIntegration.java
+++ b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SmithyIntegration.java
@@ -19,6 +19,7 @@ import java.util.Collections;
 import java.util.List;
 import software.amazon.smithy.build.FileManifest;
 import software.amazon.smithy.model.Model;
+import software.amazon.smithy.model.node.ObjectNode;
 import software.amazon.smithy.utils.AbstractCodeWriter;
 import software.amazon.smithy.utils.CodeInterceptor;
 import software.amazon.smithy.utils.CodeSection;
@@ -70,6 +71,49 @@ public interface SmithyIntegration<S, W extends SymbolWriter<W, ?>, C extends Co
         return 0;
     }
 
+    /**
+     * Configures the integration.
+     *
+     * <p>This provides access to both the parsed settings for the generator and
+     * an unparsed {@link ObjectNode} containing settings for this particular
+     * integration.
+     *
+     * <p>The following {@code smithy-build.json} file contains an example of how
+     * this configuration will be set.
+     *
+     * <pre>{@code
+     * {
+     *     "version": "1.0",
+     *     "projections": {
+     *         "codegen-projection": {
+     *             "plugins": {
+     *                 "code-generator": {
+     *                     "service": "com.example#DocumentedService",
+     *                     "integrations": {
+     *                         "my-integration": {
+     *                             "example-setting": "foo"
+     *                         }
+     *                     }
+     *                 }
+     *             }
+     *         }
+     *     }
+     * }
+     * }</pre>
+     *
+     * <p>In this example, an integration whose {@link #name} is {@code my-integration}
+     * Would receive the extra settings from the key of the same name within the
+     * {@code integrations} node.
+     *
+     * <p>Integrations SHOULD use modeled traits as much as possible to drive
+     * configuration. This is intended for configuration that doesn't make sense
+     * as a trait, such as configuring a documentation theme.
+     *
+     * @param settings Settings used to generate code.
+     * @param integrationSettings Settings used to configure integrations.
+     */
+    default void configure(S settings, ObjectNode integrationSettings) {}
+
     /**
      * Gets the names of integrations that this integration must come before.
      *
@@ -103,7 +147,7 @@ public interface SmithyIntegration<S, W extends SymbolWriter<W, ?>, C extends Co
      * <p>By default, this method will return the given {@code model} as-is.
      *
      * @param model Model being generated.
-     * @param settings Setting used to generate code.
+     * @param settings Settings used to generate code.
      * @return Returns the updated model.
      */
     default Model preprocessModel(Model model, S settings) {
@@ -122,7 +166,7 @@ public interface SmithyIntegration<S, W extends SymbolWriter<W, ?>, C extends Co
      * <p>This integration method should be called only after {@link #preprocessModel}.
      *
      * @param model Model being generated.
-     * @param settings Setting used to generate.
+     * @param settings Settings used to generate.
      * @param symbolProvider The original {@code SymbolProvider}.
      * @return The decorated {@code SymbolProvider}.
      */
diff --git a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/CodegenDirector.java b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/CodegenDirector.java
index 127f746f9..81e024138 100644
--- a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/CodegenDirector.java
+++ b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/CodegenDirector.java
@@ -36,6 +36,7 @@ import software.amazon.smithy.model.Model;
 import software.amazon.smithy.model.neighbor.Walker;
 import software.amazon.smithy.model.node.Node;
 import software.amazon.smithy.model.node.NodeMapper;
+import software.amazon.smithy.model.node.ObjectNode;
 import software.amazon.smithy.model.shapes.EnumShape;
 import software.amazon.smithy.model.shapes.IntEnumShape;
 import software.amazon.smithy.model.shapes.OperationShape;
@@ -74,6 +75,7 @@ public final class CodegenDirector<
     private ShapeId service;
     private Model model;
     private S settings;
+    private ObjectNode integrationSettings = Node.objectNode();
     private FileManifest fileManifest;
     private Supplier<Iterable<I>> integrationFinder;
     private DirectedCodegen<C, S, I> directedCodegen;
@@ -143,6 +145,8 @@ public final class CodegenDirector<
     /**
      * Sets the required settings object used for code generation.
      *
+     * <p>{@link #integrationSettings} MUST also be set.
+     *
      * @param settings Settings object.
      */
     public void settings(S settings) {
@@ -159,6 +163,9 @@ public final class CodegenDirector<
      * You will need to manually deserialize your settings if using types that
      * are not supported by Smithy's {@link NodeMapper}.
      *
+     * <p>This will also set {@link #integrationSettings} if the {@code integrations}
+     * key is present.
+     *
      * @param settingsType Settings type to deserialize into.
      * @param settingsNode Settings node value to deserialize.
      * @return Returns the deserialized settings as this is needed to provide a service shape ID.
@@ -167,9 +174,48 @@ public final class CodegenDirector<
         LOGGER.fine(() -> "Loading codegen settings from node value: " + settingsNode.getSourceLocation());
         S deserialized = new NodeMapper().deserialize(settingsNode, settingsType);
         settings(deserialized);
+        settingsNode.asObjectNode()
+            .flatMap(node -> node.getObjectMember("integrations"))
+            .ifPresent(this::integrationSettings);
         return deserialized;
     }
 
+    /**
+     * Sets the settings node to be passed to integrations.
+     *
+     * <p>Generators MUST set this with the {@code integrations} key from their
+     * plugin settings.
+     *
+     * <pre>{@code
+     * {
+     *     "version": "1.0",
+     *     "projections": {
+     *         "codegen-projection": {
+     *             "plugins": {
+     *                 "code-generator": {
+     *                     "service": "com.example#DocumentedService",
+     *                     "integrations": {
+     *                         "my-integration": {
+     *                             "example-setting": "foo"
+     *                         }
+     *                     }
+     *                 }
+     *             }
+     *         }
+     *     }
+     * }
+     * }</pre>
+     *
+     * <p>In this example, the value of the {@code integrations} key is what must
+     * be passed to this method. The value of the {@code my-integration} key will
+     * then be provided to an integration with the name {@code my-integration}.
+     *
+     * @param integrationSettings Settings used to configure integrations.
+     */
+    public void integrationSettings(ObjectNode integrationSettings) {
+        this.integrationSettings = Objects.requireNonNull(integrationSettings);
+    }
+
     /**
      * Sets the required file manifest used to write files to disk.
      *
@@ -366,7 +412,10 @@ public final class CodegenDirector<
     private List<I> findIntegrations() {
         LOGGER.fine(() -> "Finding integration implementations of " + integrationClass.getName());
         List<I> integrations = SmithyIntegration.sort(integrationFinder.get());
-        integrations.forEach(i -> LOGGER.finest(() -> "Found integration " + i.getClass().getCanonicalName()));
+        integrations.forEach(i -> {
+            LOGGER.finest(() -> "Found integration " + i.getClass().getCanonicalName());
+            i.configure(settings, integrationSettings.getObjectMember(i.name()).orElse(Node.objectNode()));
+        });
         return integrations;
     }
 
diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PrivateAccessValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PrivateAccessValidator.java
index 3ca96db18..b99bdd686 100644
--- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PrivateAccessValidator.java
+++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PrivateAccessValidator.java
@@ -24,6 +24,7 @@ import software.amazon.smithy.model.neighbor.NeighborProvider;
 import software.amazon.smithy.model.neighbor.Relationship;
 import software.amazon.smithy.model.neighbor.RelationshipType;
 import software.amazon.smithy.model.shapes.Shape;
+import software.amazon.smithy.model.shapes.ShapeId;
 import software.amazon.smithy.model.traits.PrivateTrait;
 import software.amazon.smithy.model.validation.AbstractValidator;
 import software.amazon.smithy.model.validation.ValidationEvent;
@@ -50,17 +51,18 @@ public final class PrivateAccessValidator extends AbstractValidator {
         String namespace = shape.getId().getNamespace();
         for (Relationship rel : relationships) {
             if (!rel.getShape().getId().getNamespace().equals(namespace)) {
-                ValidationEvent privateAccessValidationEvent = getPrivateAccessValidationEvent(rel);
-                events.add(privateAccessValidationEvent);
+                events.add(getPrivateAccessValidationEvent(rel));
             }
         }
     }
 
     private ValidationEvent getPrivateAccessValidationEvent(Relationship relationship) {
+        ShapeId neighborId = relationship.expectNeighborShape().getId();
         String message = String.format(
                 "This shape has an invalid %s relationship that targets a private shape, `%s`, in another namespace.",
                 relationship.getRelationshipType().toString().toLowerCase(Locale.US),
-                relationship.getNeighborShape().get().getId());
+                neighborId
+        );
 
         // For now, emit a warning for trait relationships instead of an error. This is because private access on trait
         // relationships was not being validated in the past, so emitting a warning maintains backward compatibility.


Test patch:
diff --git a/smithy-aws-protocol-tests/model/awsJson1_0/defaults.smithy b/smithy-aws-protocol-tests/model/awsJson1_0/defaults.smithy
new file mode 100644
index 000000000..fbac5fe08
--- /dev/null
+++ b/smithy-aws-protocol-tests/model/awsJson1_0/defaults.smithy
@@ -0,0 +1,333 @@
+$version: "2.0"
+
+namespace aws.protocoltests.json10
+
+use aws.protocols#awsJson1_0
+use smithy.test#httpRequestTests
+use smithy.test#httpResponseTests
+
+apply OperationWithDefaults @httpRequestTests([
+    {
+        id: "AwsJson10ClientPopulatesDefaultValuesInInput"
+        documentation: "Client populates default values in input."
+        appliesTo: "client"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        method: "POST"
+        bodyMediaType: "application/json"
+        uri: "/"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+                "defaults": {
+                    "defaultString": "hi",
+                    "defaultBoolean": true,
+                    "defaultList": [],
+                    "defaultDocumentMap": {},
+                    "defaultDocumentString": "hi",
+                    "defaultDocumentBoolean": true,
+                    "defaultDocumentList": [],
+                    "defaultTimestamp": 0,
+                    "defaultBlob": "YWJj",
+                    "defaultByte": 1,
+                    "defaultShort": 1,
+                    "defaultInteger": 10,
+                    "defaultLong": 100,
+                    "defaultFloat": 1.0,
+                    "defaultDouble": 1.0,
+                    "defaultMap": {},
+                    "defaultEnum": "FOO",
+                    "defaultIntEnum": 1
+                }
+            }"""
+        params: {
+            defaults: {}
+        }
+    }
+    {
+        id: "AwsJson10ClientSkipsTopLevelDefaultValuesInInput"
+        documentation: "Client skips top level default values in input."
+        appliesTo: "client"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        method: "POST"
+        bodyMediaType: "application/json"
+        uri: "/"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+            }"""
+        params: {
+        }
+    }
+    {
+        id: "AwsJson10ClientUsesExplicitlyProvidedMemberValuesOverDefaults"
+        documentation: "Client uses explicitly provided member values over defaults"
+        appliesTo: "client"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        method: "POST"
+        bodyMediaType: "application/json"
+        uri: "/"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        params: {
+            defaults: {
+                defaultString: "bye"
+                defaultBoolean: true
+                defaultList: ["a"]
+                defaultDocumentMap: {name: "Jack"}
+                defaultDocumentString: "bye"
+                defaultDocumentBoolean: true
+                defaultDocumentList: ["b"]
+                defaultNullDocument: "notNull"
+                defaultTimestamp: 1
+                defaultBlob: "hi"
+                defaultByte: 2
+                defaultShort: 2
+                defaultInteger: 20
+                defaultLong: 200
+                defaultFloat: 2.0
+                defaultDouble: 2.0
+                defaultMap: {name: "Jack"}
+                defaultEnum: "BAR"
+                defaultIntEnum: 2
+            }
+        }
+        body: """
+            {
+                "defaults": {
+                    "defaultString": "bye",
+                    "defaultBoolean": true,
+                    "defaultList": ["a"],
+                    "defaultDocumentMap": {"name": "Jack"},
+                    "defaultDocumentString": "bye",
+                    "defaultDocumentBoolean": true,
+                    "defaultDocumentList": ["b"],
+                    "defaultNullDocument": "notNull",
+                    "defaultTimestamp": 1,
+                    "defaultBlob": "aGk=",
+                    "defaultByte": 2,
+                    "defaultShort": 2,
+                    "defaultInteger": 20,
+                    "defaultLong": 200,
+                    "defaultFloat": 2.0,
+                    "defaultDouble": 2.0,
+                    "defaultMap": {"name": "Jack"},
+                    "defaultEnum": "BAR",
+                    "defaultIntEnum": 2
+                }
+            }"""
+    }
+    {
+        id: "AwsJson10ServerPopulatesDefaultsWhenMissingInRequestBody"
+        documentation: "Server populates default values when missing in request body."
+        appliesTo: "server"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        method: "POST"
+        bodyMediaType: "application/json"
+        uri: "/"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+            "defaults": {}
+            }"""
+        params: {
+            defaults: {
+                defaultString: "hi"
+                defaultBoolean: true
+                defaultList: []
+                defaultDocumentMap: {}
+                defaultDocumentString: "hi"
+                defaultDocumentBoolean: true
+                defaultDocumentList: []
+                defaultTimestamp: 0
+                defaultBlob: "abc"
+                defaultByte: 1
+                defaultShort: 1
+                defaultInteger: 10
+                defaultLong: 100
+                defaultFloat: 1.0
+                defaultDouble: 1.0
+                defaultMap: {}
+                defaultEnum: "FOO"
+                defaultIntEnum: 1
+            },
+            topLevelDefault: "hi"
+        }
+    }
+])
+
+apply OperationWithDefaults @httpResponseTests([
+    {
+        id: "AwsJson10ClientPopulatesDefaultsValuesWhenMissingInResponse"
+        documentation: "Client populates default values when missing in response."
+        appliesTo: "client"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        code: 200
+        bodyMediaType: "application/json"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: "{}"
+        params: {
+            defaultString: "hi"
+            defaultBoolean: true
+            defaultList: []
+            defaultDocumentMap: {}
+            defaultDocumentString: "hi"
+            defaultDocumentBoolean: true
+            defaultDocumentList: []
+            defaultTimestamp: 0
+            defaultBlob: "abc"
+            defaultByte: 1
+            defaultShort: 1
+            defaultInteger: 10
+            defaultLong: 100
+            defaultFloat: 1.0
+            defaultDouble: 1.0
+            defaultMap: {}
+            defaultEnum: "FOO"
+            defaultIntEnum: 1
+        }
+    }
+    {
+        id: "AwsJson10ClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse"
+        documentation: "Client ignores default values if member values are present in the response."
+        appliesTo: "client"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        code: 200
+        bodyMediaType: "application/json"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+                "defaultString": "bye",
+                "defaultBoolean": false,
+                "defaultList": ["a"],
+                "defaultDocumentMap": {"name": "Jack"},
+                "defaultDocumentString": "bye",
+                "defaultDocumentBoolean": false,
+                "defaultDocumentList": ["b"],
+                "defaultNullDocument": "notNull",
+                "defaultTimestamp": 2,
+                "defaultBlob": "aGk=",
+                "defaultByte": 2,
+                "defaultShort": 2,
+                "defaultInteger": 20,
+                "defaultLong": 200,
+                "defaultFloat": 2.0,
+                "defaultDouble": 2.0,
+                "defaultMap": {"name": "Jack"},
+                "defaultEnum": "BAR",
+                "defaultIntEnum": 2
+            }"""
+        params: {
+            defaultString: "bye"
+            defaultBoolean: false
+            defaultList: ["a"]
+            defaultDocumentMap: {name: "Jack"}
+            defaultDocumentString: "bye"
+            defaultDocumentBoolean: false
+            defaultDocumentList: ["b"]
+            defaultNullDocument: "notNull"
+            defaultTimestamp: 2
+            defaultBlob: "hi"
+            defaultByte: 2
+            defaultShort: 2
+            defaultInteger: 20
+            defaultLong: 200
+            defaultFloat: 2.0
+            defaultDouble: 2.0
+            defaultMap: {name: "Jack"}
+            defaultEnum: "BAR"
+            defaultIntEnum: 2
+        }
+    }
+    {
+        id: "AwsJson10ServerPopulatesDefaultsInResponseWhenMissingInParams"
+        documentation: "Server populates default values in response when missing in params."
+        appliesTo: "server"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        code: 200
+        bodyMediaType: "application/json"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+                "defaultString": "hi",
+                "defaultBoolean": true,
+                "defaultList": [],
+                "defaultDocumentMap": {},
+                "defaultDocumentString": "hi",
+                "defaultDocumentBoolean": true,
+                "defaultDocumentList": [],
+                "defaultTimestamp": 0,
+                "defaultBlob": "YWJj",
+                "defaultByte": 1,
+                "defaultShort": 1,
+                "defaultInteger": 10,
+                "defaultLong": 100,
+                "defaultFloat": 1.0,
+                "defaultDouble": 1.0,
+                "defaultMap": {},
+                "defaultEnum": "FOO",
+                "defaultIntEnum": 1
+            }"""
+        params: {}
+    }
+])
+
+operation OperationWithDefaults {
+    input := {
+        defaults: Defaults
+
+        topLevelDefault: String = "hi" // Client should ignore default values in input shape
+    }
+
+    output := with [DefaultsMixin] {}
+}
+
+structure Defaults with [DefaultsMixin] {}
+
+@mixin
+structure DefaultsMixin {
+    defaultString: String = "hi"
+    defaultBoolean: Boolean = true
+    defaultList: TestStringList = []
+    defaultDocumentMap: Document = {}
+    defaultDocumentString: Document = "hi"
+    defaultDocumentBoolean: Document = true
+    defaultDocumentList: Document = []
+    defaultNullDocument: Document = null
+    defaultTimestamp: Timestamp = 0
+    defaultBlob: Blob = "abc"
+    defaultByte: Byte = 1
+    defaultShort: Short = 1
+    defaultInteger: Integer = 10
+    defaultLong: Long = 100
+    defaultFloat: Float = 1.0
+    defaultDouble: Double = 1.0
+    defaultMap: TestStringMap = {}
+    defaultEnum: TestEnum = "FOO"
+    defaultIntEnum: TestIntEnum = 1
+}
+
+list TestStringList {
+    member: String
+}
+
+map TestStringMap {
+    key: String
+    value: String
+}
+
+enum TestEnum {
+    FOO
+    BAR
+    BAZ
+}
+
+intEnum TestIntEnum {
+    ONE = 1
+    TWO = 2
+}
diff --git a/smithy-aws-protocol-tests/model/awsJson1_0/main.smithy b/smithy-aws-protocol-tests/model/awsJson1_0/main.smithy
index f01642df7..bc9e29180 100644
--- a/smithy-aws-protocol-tests/model/awsJson1_0/main.smithy
+++ b/smithy-aws-protocol-tests/model/awsJson1_0/main.smithy
@@ -30,6 +30,10 @@ service JsonRpc10 {
         HostWithPathOperation,
 
         // requestCompression trait tests
-        PutWithContentEncoding
+        PutWithContentEncoding,
+
+        OperationWithDefaults,
+        OperationWithRequiredMembers,
+        OperationWithNestedStructure
     ]
 }
diff --git a/smithy-aws-protocol-tests/model/awsJson1_0/nestedDefaults.smithy b/smithy-aws-protocol-tests/model/awsJson1_0/nestedDefaults.smithy
new file mode 100644
index 000000000..d31c7ba9b
--- /dev/null
+++ b/smithy-aws-protocol-tests/model/awsJson1_0/nestedDefaults.smithy
@@ -0,0 +1,408 @@
+$version: "2.0"
+
+namespace aws.protocoltests.json10
+
+use aws.protocols#awsJson1_0
+use smithy.test#httpRequestTests
+use smithy.test#httpResponseTests
+
+apply OperationWithNestedStructure @httpRequestTests([
+    {
+        id: "AwsJson10ClientPopulatesNestedDefaultValuesWhenMissing"
+        documentation: "Client populates nested default values when missing."
+        appliesTo: "client"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        method: "POST"
+        bodyMediaType: "application/json"
+        uri: "/"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+                "topLevel": {
+                    "dialog": {
+                        "language": "en",
+                        "greeting": "hi"
+                    },
+                    "dialogList": [
+                        {
+                            "greeting": "hi"
+                        },
+                        {
+                            "greeting": "hi",
+                            "farewell": {
+                                "phrase": "bye"
+                            }
+                        },
+                        {
+                            "language": "it",
+                            "greeting": "ciao",
+                            "farewell": {
+                                "phrase": "arrivederci"
+                            }
+                        }
+                    ],
+                    "dialogMap": {
+                        "emptyDialog": {
+                            "greeting": "hi"
+                        },
+                        "partialEmptyDialog": {
+                            "language": "en",
+                            "greeting": "hi",
+                            "farewell": {
+                                "phrase": "bye"
+                            }
+                        },
+                        "nonEmptyDialog": {
+                            "greeting": "konnichiwa",
+                            "farewell": {
+                                "phrase": "sayonara"
+                            }
+                        }
+                    }
+                }
+            }"""
+        params: {
+            "topLevel": {
+                "dialog": {
+                    "language": "en"
+                },
+                "dialogList": [
+                    {
+                    },
+                    {
+                        "farewell": {}
+                    },
+                    {
+                        "language": "it",
+                        "greeting": "ciao",
+                        "farewell": {
+                            "phrase": "arrivederci"
+                        }
+                    }
+                ],
+                "dialogMap": {
+                    "emptyDialog": {
+                    },
+                    "partialEmptyDialog": {
+                        "language": "en",
+                        "farewell": {}
+                    },
+                    "nonEmptyDialog": {
+                        "greeting": "konnichiwa",
+                        "farewell": {
+                            "phrase": "sayonara"
+                        }
+                    }
+                }
+            }
+        }
+    }
+    {
+        id: "AwsJson10ServerPopulatesNestedDefaultsWhenMissingInRequestBody"
+        documentation: "Server populates nested default values when missing in request body."
+        appliesTo: "server"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        method: "POST"
+        bodyMediaType: "application/json"
+        uri: "/"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+                "topLevel": {
+                    "dialog": {
+                        "language": "en"
+                    },
+                    "dialogList": [
+                        {
+                        },
+                        {
+                            "farewell": {}
+                        },
+                        {
+                            "language": "it",
+                            "greeting": "ciao",
+                            "farewell": {
+                                "phrase": "arrivederci"
+                            }
+                        }
+                    ],
+                    "dialogMap": {
+                        "emptyDialog": {
+                        },
+                        "partialEmptyDialog": {
+                            "language": "en",
+                            "farewell": {}
+                        },
+                        "nonEmptyDialog": {
+                            "greeting": "konnichiwa",
+                            "farewell": {
+                                "phrase": "sayonara"
+                            }
+                        }
+                    }
+                }
+            }"""
+        params: {
+            "topLevel": {
+                "dialog": {
+                    "language": "en"
+                    "greeting": "hi",
+                }
+                "dialogList": [
+                    {
+                        "greeting": "hi",
+                    },
+                    {
+                        "greeting": "hi",
+                        "farewell": {
+                            "phrase": "bye",
+                        }
+                    },
+                    {
+                        "language": "it",
+                        "greeting": "ciao",
+                        "farewell": {
+                            "phrase": "arrivederci"
+                        }
+                    }
+                ],
+                "dialogMap": {
+                    "emptyDialog": {
+                        "greeting": "hi",
+                    },
+                    "partialEmptyDialog": {
+                        "language": "en",
+                        "greeting": "hi",
+                        "farewell": {
+                            "phrase": "bye",
+                        }
+                    },
+                    "nonEmptyDialog": {
+                        "greeting": "konnichiwa",
+                        "farewell": {
+                            "phrase": "sayonara"
+                        }
+                    }
+                }
+            }
+        }
+    }
+])
+
+apply OperationWithNestedStructure @httpResponseTests([
+    {
+        id: "AwsJson10ClientPopulatesNestedDefaultsWhenMissingInResponseBody"
+        documentation: "Client populates nested default values when missing in response body."
+        appliesTo: "client"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        code: 200
+        bodyMediaType: "application/json"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+                "dialog": {
+                    "language": "en"
+                },
+                "dialogList": [
+                    {
+                    },
+                    {
+                        "farewell": {}
+                    },
+                    {
+                        "language": "it",
+                        "greeting": "ciao",
+                        "farewell": {
+                            "phrase": "arrivederci"
+                        }
+                    }
+                ],
+                "dialogMap": {
+                    "emptyDialog": {
+                    },
+                    "partialEmptyDialog": {
+                        "language": "en",
+                        "farewell": {}
+                    },
+                    "nonEmptyDialog": {
+                        "greeting": "konnichiwa",
+                        "farewell": {
+                            "phrase": "sayonara"
+                        }
+                    }
+                }
+            }"""
+        params: {
+            "dialog": {
+                "language": "en"
+                "greeting": "hi",
+            }
+            "dialogList": [
+                {
+                    "greeting": "hi",
+                },
+                {
+                    "greeting": "hi",
+                    "farewell": {
+                        "phrase": "bye",
+                    }
+                },
+                {
+                    "language": "it",
+                    "greeting": "ciao",
+                    "farewell": {
+                        "phrase": "arrivederci"
+                    }
+                }
+            ],
+            "dialogMap": {
+                "emptyDialog": {
+                    "greeting": "hi",
+                },
+                "partialEmptyDialog": {
+                    "language": "en",
+                    "greeting": "hi",
+                    "farewell": {
+                        "phrase": "bye",
+                    }
+                },
+                "nonEmptyDialog": {
+                    "greeting": "konnichiwa",
+                    "farewell": {
+                        "phrase": "sayonara"
+                    }
+                }
+            }
+        }
+    }
+    {
+        id: "AwsJson10ServerPopulatesNestedDefaultValuesWhenMissingInInResponseParams"
+        documentation: "Server populates nested default values when missing in response params."
+        appliesTo: "server"
+        tags: ["defaults"]
+        protocol: awsJson1_0
+        code: 200
+        bodyMediaType: "application/json"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: """
+            {
+                "dialog": {
+                    "language": "en",
+                    "greeting": "hi"
+                },
+                "dialogList": [
+                    {
+                        "greeting": "hi"
+                    },
+                    {
+                        "greeting": "hi",
+                        "farewell": {
+                            "phrase": "bye"
+                        }
+                    },
+                    {
+                        "language": "it",
+                        "greeting": "ciao",
+                        "farewell": {
+                            "phrase": "arrivederci"
+                        }
+                    }
+                ],
+                "dialogMap": {
+                    "emptyDialog": {
+                        "greeting": "hi"
+                    },
+                    "partialEmptyDialog": {
+                        "language": "en",
+                        "greeting": "hi",
+                        "farewell": {
+                            "phrase": "bye"
+                        }
+                    },
+                    "nonEmptyDialog": {
+                        "greeting": "konnichiwa",
+                        "farewell": {
+                            "phrase": "sayonara"
+                        }
+                    }
+                }
+            }"""
+        params: {
+            "dialog": {
+                "language": "en"
+            },
+            "dialogList": [
+                {
+                },
+                {
+                    "farewell": {}
+                },
+                {
+                    "language": "it",
+                    "greeting": "ciao",
+                    "farewell": {
+                        "phrase": "arrivederci"
+                    }
+                }
+            ],
+            "dialogMap": {
+                "emptyDialog": {
+                },
+                "partialEmptyDialog": {
+                    "language": "en",
+                    "farewell": {}
+                },
+                "nonEmptyDialog": {
+                    "greeting": "konnichiwa",
+                    "farewell": {
+                        "phrase": "sayonara"
+                    }
+                }
+            }
+        }
+    }
+])
+
+operation OperationWithNestedStructure {
+    input := {
+        @required
+        topLevel: TopLevel
+    }
+
+    output := with [NestedDefaultsMixin] {
+    }
+}
+
+structure TopLevel with [NestedDefaultsMixin] {
+
+}
+
+@mixin
+structure NestedDefaultsMixin {
+    @required
+    dialog: Dialog
+    dialogList: DialogList = []
+    dialogMap: DialogMap = {}
+}
+
+structure Dialog {
+    language: String
+    greeting: String = "hi"
+    farewell: Farewell
+}
+
+structure Farewell {
+    phrase: String = "bye"
+}
+
+list DialogList {
+    member: Dialog
+}
+
+map DialogMap {
+    key: String
+    value: Dialog
+}
diff --git a/smithy-aws-protocol-tests/model/awsJson1_0/required.smithy b/smithy-aws-protocol-tests/model/awsJson1_0/required.smithy
new file mode 100644
index 000000000..036bf45e9
--- /dev/null
+++ b/smithy-aws-protocol-tests/model/awsJson1_0/required.smithy
@@ -0,0 +1,178 @@
+$version: "2.0"
+
+namespace aws.protocoltests.json10
+
+use aws.protocols#awsJson1_0
+use smithy.test#httpResponseTests
+
+apply OperationWithRequiredMembers @httpResponseTests([
+    {
+        id: "AwsJson10ClientErrorCorrectsWhenServerFailsToSerializeRequiredValues"
+        documentation: "Client error corrects when server fails to serialize required values."
+        appliesTo: "client"
+        tags: ["defaults", "error-correction"]
+        protocol: awsJson1_0
+        code: 200
+        bodyMediaType: "application/json"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: "{}"
+        params: {
+            requiredString: ""
+            requiredBoolean: false
+            requiredList: []
+            requiredTimestamp: 0
+            requiredBlob: ""
+            requiredByte: 0
+            requiredShort: 0
+            requiredInteger: 0
+            requiredLong: 0
+            requiredFloat: 0.0
+            requiredDouble: 0.0
+            requiredMap: {}
+        }
+    }
+])
+
+operation OperationWithRequiredMembers {
+    output := with [RequiredMembersMixin] {
+    }
+}
+
+apply OperationWithRequiredMembersWithDefaults @httpResponseTests([
+    {
+        id: "AwsJson10ClientErrorCorrectsWithDefaultValuesWhenServerFailsToSerializeRequiredValues"
+        documentation: "Client error corrects with default values when server fails to serialize required values."
+        appliesTo: "client"
+        tags: ["defaults", "error-correction"]
+        protocol: awsJson1_0
+        code: 200
+        bodyMediaType: "application/json"
+        headers: {"Content-Type": "application/x-amz-json-1.0"}
+        body: "{}"
+        params: {
+            requiredString: "hi"
+            requiredBoolean: true
+            requiredList: []
+            requiredTimestamp: 1
+            requiredBlob: "{}"
+            requiredByte: 1
+            requiredShort: 1
+            requiredInteger: 10
+            requiredLong: 100
+            requiredFloat: 1.0
+            requiredDouble: 1.0
+            requiredMap: {}
+            requiredEnum: "FOO"
+            requiredIntEnum: 1
+        }
+    }
+])
+
+operation OperationWithRequiredMembersWithDefaults {
+    output := with [RequiredMembersWithDefaultsMixin] {
+    }
+}
+
+@mixin
+structure RequiredMembersMixin {
+    @required
+    requiredString: String
+
+    @required
+    requiredBoolean: Boolean
+
+    @required
+    requiredList: RequiredStringList
+
+    @required
+    requiredTimestamp: Timestamp
+
+    @required
+    requiredBlob: Blob
+
+    @required
+    requiredByte: Byte
+
+    @required
+    requiredShort: Short
+
+    @required
+    requiredInteger: Integer
+
+    @required
+    requiredLong: Long
+
+    @required
+    requiredFloat: Float
+
+    @required
+    requiredDouble: Double
+
+    @required
+    requiredMap: RequiredStringMap
+}
+
+@mixin
+structure RequiredMembersWithDefaultsMixin {
+    @required
+    requiredString: String = "hi"
+
+    @required
+    requiredBoolean: Boolean = true
+
+    @required
+    requiredList: RequiredStringList = []
+
+    @required
+    requiredTimestamp: Timestamp = 1
+
+    @required
+    requiredBlob: Blob = "{}"
+
+    @required
+    requiredByte: Byte = 1
+
+    @required
+    requiredShort: Short = 1
+
+    @required
+    requiredInteger: Integer = 10
+
+    @required
+    requiredLong: Long = 100
+
+    @required
+    requiredFloat: Float = 1.0
+
+    @required
+    requiredDouble: Double = 1.0
+
+    @required
+    requiredMap: RequiredStringMap = {}
+
+    @required
+    requiredEnum: RequiredEnum = "FOO"
+
+    @required
+    requiredIntEnum: RequiredIntEnum = 1
+}
+
+list RequiredStringList {
+    member: String
+}
+
+map RequiredStringMap {
+    key: String
+    value: String
+}
+
+enum RequiredEnum {
+    FOO
+    BAR
+    BAZ
+}
+
+intEnum RequiredIntEnum {
+    ONE = 1
+    TWO = 2
+}
diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/endpoint-error.errors b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/endpoint-error.errors
index be91fa94b..8dd18d709 100644
--- a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/endpoint-error.errors
+++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/endpoint-error.errors
@@ -1,2 +1,2 @@
-[DANGER] ns.foo#FooService: Services SHOULD define an error which indicates an endpoint is invalid. | ClientEndpointDiscovery
+[DANGER] ns.foo#FooService: Services SHOULD define an error which indicates an endpoint is invalid. | ClientEndpointDiscovery.MissingErrorDefinition
 [ERROR] ns.foo#GetObject: The operation `ns.foo#GetObject` is marked with `aws.api#clientDiscoveredEndpoint` and is bound to the service `ns.foo#BarService` but does not have the required error `ns.foo#InvalidEndpointError`. | ClientEndpointDiscovery
diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/no-operations.errors b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/no-operations.errors
new file mode 100644
index 000000000..489668693
--- /dev/null
+++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/no-operations.errors
@@ -0,0 +1,1 @@
+[WARNING] ns.foo#BazService: The service `ns.foo#BazService` is configured to use endpoint discovery, but has no operations bound with the `aws.api#clientDiscoveredEndpoint` trait. | ClientEndpointDiscovery.NoOperations
diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/no-operations.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/no-operations.smithy
new file mode 100644
index 000000000..ba6dc7936
--- /dev/null
+++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/no-operations.smithy
@@ -0,0 +1,66 @@
+$version: "2.0"
+
+namespace ns.foo
+
+use aws.api#clientEndpointDiscovery
+use aws.api#clientDiscoveredEndpoint
+
+@clientEndpointDiscovery(
+    operation: DescribeEndpoints,
+    error: InvalidEndpointError,
+)
+service BazService {
+    version: "2021-06-29",
+    operations: [DescribeEndpoints, GetObjectWithEndpointError],
+}
+
+operation DescribeEndpoints {
+    input: DescribeEndpointsInput,
+    output: DescribeEndpointsOutput,
+}
+
+@input
+structure DescribeEndpointsInput {
+    Operation: String,
+    Identifiers: Identifiers,
+}
+
+map Identifiers {
+    key: String,
+    value: String,
+}
+
+@output
+structure DescribeEndpointsOutput {
+    Endpoints: Endpoints,
+}
+
+list Endpoints {
+    member: Endpoint,
+}
+
+structure Endpoint {
+    Address: String,
+    CachePeriodInMinutes: Long,
+}
+
+operation GetObjectWithEndpointError {
+    input: GetObjectWithEndpointErrorInput,
+    output: GetObjectWithEndpointErrorOutput,
+    errors: [InvalidEndpointError],
+}
+
+@input
+structure GetObjectWithEndpointErrorInput {
+    @required
+    Id: String,
+}
+
+@output
+structure GetObjectWithEndpointErrorOutput {
+    Object: Blob,
+}
+
+@error("client")
+@httpError(421)
+structure InvalidEndpointError {}
diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/unbound-operations.errors b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/unbound-operations.errors
new file mode 100644
index 000000000..f3954f880
--- /dev/null
+++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/unbound-operations.errors
@@ -0,0 +1,2 @@
+[ERROR] ns.foo#GetObject: The operation `ns.foo#GetObject` is marked with `aws.api#clientDiscoveredEndpoint` and is bound to the service `ns.foo#BarService` but does not have the required error `ns.foo#InvalidEndpointError`. | ClientEndpointDiscovery
+[ERROR] ns.foo#BarService: The operation `ns.foo#DescribeEndpoints` must be bound to the service `(service: `ns.foo#BarService`)` to use it as the endpoint operation. | ClientEndpointDiscovery.UnboundOperation.DescribeEndpoints
diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/unbound-operations.smithy b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/unbound-operations.smithy
new file mode 100644
index 000000000..083ca4fde
--- /dev/null
+++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/clientendpointdiscovery/unbound-operations.smithy
@@ -0,0 +1,97 @@
+$version: "2.0"
+
+namespace ns.foo
+
+use aws.api#clientEndpointDiscovery
+use aws.api#clientDiscoveredEndpoint
+
+// This DOES have an error, but it's not bound to the operations. This should
+// result in an ERROR.
+@clientEndpointDiscovery(
+    operation: DescribeEndpoints,
+    error: InvalidEndpointError,
+)
+service BarService {
+    version: "2021-06-29",
+    operations: [GetObject],
+}
+
+// This DOES have an error, and it IS bound to the operations. This should
+// not produce any validation events.
+@clientEndpointDiscovery(
+    operation: DescribeEndpoints,
+    error: InvalidEndpointError,
+)
+service BazService {
+    version: "2021-06-29",
+    operations: [DescribeEndpoints, GetObjectWithEndpointError],
+}
+
+operation DescribeEndpoints {
+    input: DescribeEndpointsInput,
+    output: DescribeEndpointsOutput,
+}
+
+@input
+structure DescribeEndpointsInput {
+    Operation: String,
+    Identifiers: Identifiers,
+}
+
+map Identifiers {
+    key: String,
+    value: String,
+}
+
+@output
+structure DescribeEndpointsOutput {
+    Endpoints: Endpoints,
+}
+
+list Endpoints {
+    member: Endpoint,
+}
+
+structure Endpoint {
+    Address: String,
+    CachePeriodInMinutes: Long,
+}
+
+@clientDiscoveredEndpoint(required: true)
+operation GetObject {
+    input: GetObjectInput,
+    output: GetObjectOutput,
+}
+
+@input
+structure GetObjectInput {
+    @required
+    Id: String,
+}
+
+@output
+structure GetObjectOutput {
+    Object: Blob,
+}
+
+@clientDiscoveredEndpoint(required: true)
+operation GetObjectWithEndpointError {
+    input: GetObjectWithEndpointErrorInput,
+    output: GetObjectWithEndpointErrorOutput,
+    errors: [InvalidEndpointError],
+}
+
+@input
+structure GetObjectWithEndpointErrorInput {
+    @required
+    Id: String,
+}
+
+@output
+structure GetObjectWithEndpointErrorOutput {
+    Object: Blob,
+}
+
+@error("client")
+@httpError(421)
+structure InvalidEndpointError {}
diff --git a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/CapturingIntegration.java b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/CapturingIntegration.java
new file mode 100644
index 000000000..73fe5997d
--- /dev/null
+++ b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/CapturingIntegration.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package software.amazon.smithy.codegen.core.directed;
+
+import software.amazon.smithy.model.node.Node;
+import software.amazon.smithy.model.node.ObjectNode;
+
+public class CapturingIntegration implements TestIntegration {
+    public ObjectNode integrationSettings = Node.objectNode();
+
+    @Override
+    public String name() {
+        return "capturing-integration";
+    }
+
+    @Override
+    public void configure(TestSettings settings, ObjectNode integrationSettings) {
+        this.integrationSettings = integrationSettings;
+    }
+}
diff --git a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/CodegenDirectorTest.java b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/CodegenDirectorTest.java
index 295633630..df320005b 100644
--- a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/CodegenDirectorTest.java
+++ b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/CodegenDirectorTest.java
@@ -19,6 +19,9 @@ import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.contains;
 import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.notNullValue;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -33,6 +36,7 @@ import software.amazon.smithy.codegen.core.WriterDelegator;
 import software.amazon.smithy.model.Model;
 import software.amazon.smithy.model.node.ExpectationNotMetException;
 import software.amazon.smithy.model.node.Node;
+import software.amazon.smithy.model.node.ObjectNode;
 import software.amazon.smithy.model.shapes.ShapeId;
 
 public class CodegenDirectorTest {
@@ -42,6 +46,8 @@ public class CodegenDirectorTest {
         public final List<ShapeId> generatedEnumTypeEnums = new ArrayList<>();
         public final List<ShapeId> generatedStringTypeEnums = new ArrayList<>();
 
+        public final List<TestIntegration> integrations = new ArrayList<>();
+
         @Override
         public SymbolProvider createSymbolProvider(CreateSymbolProviderDirective<TestSettings> directive) {
             return shape -> Symbol.builder()
@@ -52,6 +58,8 @@ public class CodegenDirectorTest {
 
         @Override
         public TestContext createContext(CreateContextDirective<TestSettings, TestIntegration> directive) {
+            integrations.clear();
+            integrations.addAll(directive.integrations());
             WriterDelegator<TestWriter> delegator = new WriterDelegator<>(
                     directive.fileManifest(),
                     directive.symbolProvider(),
@@ -339,4 +347,42 @@ public class CodegenDirectorTest {
                 ShapeId.from("smithy.example#Foo")
         ));
     }
+
+    @Test
+    public void testConfiguresIntegrations() {
+        TestDirected testDirected = new TestDirected();
+        CodegenDirector<TestWriter, TestIntegration, TestContext, TestSettings> runner
+            = new CodegenDirector<>();
+        FileManifest manifest = new MockManifest();
+        Model model = Model.assembler()
+            .addImport(getClass().getResource("needs-sorting.smithy"))
+            .assemble()
+            .unwrap();
+
+        ObjectNode integrationSettings = Node.objectNode().withMember("spam", "eggs");
+        ObjectNode allIntegrationSettings = Node.objectNode()
+                .withMember("capturing-integration", integrationSettings);
+        ObjectNode settings = Node.objectNode()
+            .withMember("foo", "hi")
+            .withMember("integrations", allIntegrationSettings);
+        runner.settings(TestSettings.class, settings);
+        runner.directedCodegen(testDirected);
+        runner.fileManifest(manifest);
+        runner.service(ShapeId.from("smithy.example#Foo"));
+        runner.model(model);
+        runner.integrationClass(TestIntegration.class);
+        runner.performDefaultCodegenTransforms();
+        runner.shapeGenerationOrder(ShapeGenerationOrder.NONE);
+        runner.run();
+
+        assertThat(testDirected.integrations, not(empty()));
+        CapturingIntegration capturingIntegration = null;
+        for (TestIntegration integration : testDirected.integrations) {
+            if (integration instanceof CapturingIntegration) {
+                capturingIntegration = (CapturingIntegration) integration;
+            }
+        }
+        assertThat(capturingIntegration, notNullValue());
+        assertThat(capturingIntegration.integrationSettings, equalTo(integrationSettings));
+    }
 }
diff --git a/smithy-codegen-core/src/test/resources/META-INF/services/software.amazon.smithy.codegen.core.directed.TestIntegration b/smithy-codegen-core/src/test/resources/META-INF/services/software.amazon.smithy.codegen.core.directed.TestIntegration
new file mode 100644
index 000000000..7b3cf821d
--- /dev/null
+++ b/smithy-codegen-core/src/test/resources/META-INF/services/software.amazon.smithy.codegen.core.directed.TestIntegration
@@ -0,0 +1,1 @@
+software.amazon.smithy.codegen.core.directed.CapturingIntegration