Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hpmellema committed Feb 19, 2025
1 parent fab1a33 commit 34a560f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
11 changes: 4 additions & 7 deletions docs/source-2.0/java/client/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,10 @@ use the ``putSupportedAuthSchemes`` method:
Automatic registration
^^^^^^^^^^^^^^^^^^^^^^

The Client code generation plugin can discover auth schemes on the classpath. If a discovered auth scheme’s ID matches
an auth scheme ID in the Smithy model it will be automatically registered in the generated client.

To add an auth scheme automatically to a generated client based on a trait in the model, the auth scheme must provide
an ``AuthSchemeFactory`` implementation and register that implementation via SPI. Smithy Java client codegen will
automatically search the classpath for relevant ``AuthSchemeFactory``` implementations and attempt to match those with
a corresponding trait in the model.
The Client code generation plugin can discover auth schemes on the classpath. To be discoverable, the auth scheme
must provide an ``AuthSchemeFactory`` implementation and register that implementation via SPI. Smithy Java client
codegen plugin will automatically search the classpath for relevant ``AuthSchemeFactory``` implementations and attempt
to match those with a corresponding trait in the model.

Effective auth schemes
^^^^^^^^^^^^^^^^^^^^^^
Expand Down
14 changes: 6 additions & 8 deletions docs/source-2.0/java/client/dynamic-client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ Now, create the ``DynamicClient`` instance for this model and service:
.endpointResolver(EndpointResolver.staticEndpoint("https://api.cafe.example.com"))
.build();
.. admonition:: Important
:class: note

If an explicit protocol and transport are not provided to the builder, the builder will attempt to find protocol
and transport implementations on the classpath that match the protocol traits attached to the service.

To call the service, create an input using a ``Document`` that mirrors what's defined in the Smithy model.
The ``Document.createFromObject`` method can create a ``Document`` from a map:

Expand All @@ -61,11 +67,3 @@ The ``Document.createFromObject`` method can create a ``Document`` from a map:
var input = Document.createFromObject(Map.of("coffeeType", "COLD_BREW"));
var result = client.call("CreateOrder", input).get();
System.out.println(result);
.. admonition:: Important
:class: note

If an explicit protocol and transport are not provided to the builder, the builder will attempt to find protocol
and transport implementations on the classpath that match the protocol traits attached to the service.


23 changes: 18 additions & 5 deletions docs/source-2.0/java/client/generating-clients.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@ and can be executed with `Gradle <https://gradle.org/>`_ (recommended) or the :r
Initial setup: Gradle (recommended)
-----------------------------------

To generate a Java client for a service, start by creating a new Smithy Gradle project:
To generate a Java client for a service, start by creating a new Smithy Gradle project.

.. tip::
The ``smithy init``` CLI command can be used to create a new Smithy Gradle project:

Use the ``smithy init``` CLI command to create a new Smithy project.
The command ``smithy init -t quickstart-gradle`` will create a new
basic Smithy Gradle project.
.. code-block:: sh
smithy init -t quickstart-gradle
A Smithy Gradle project should contain a Gradle settings file, a Gradle build script,
a :ref:`smithy-build.json <smithy-build>` configuration file, and a `model/` directory
containing Smithy models. For example:

.. code-block:: sh
my-project/
├── model/
│ ├── ...
├── smithy-build.json
├── build.gradle.kts
└── settings.gradle
Apply the `smithy-base`_ plugin to your Gradle build script to build your Smithy model
and execute build plugins:
Expand Down

0 comments on commit 34a560f

Please sign in to comment.