Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
smithy-automation committed Feb 27, 2024
1 parent c5cf133 commit 4a820f8
Show file tree
Hide file tree
Showing 24 changed files with 634 additions and 177 deletions.
4 changes: 2 additions & 2 deletions 2.0/_sources/aws/amazon-apigateway.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ operation within the service.
.. code-block:: json
{
"smithy": "1.0",
"version": "2.0",
"shapes": {
"smithy.example#Weather": {
"type": "service",
Expand Down Expand Up @@ -531,7 +531,7 @@ The following example defines an operation that uses a mock integration.
.. code-block:: json
{
"smithy": "1.0",
"smithy": "2.0",
"shapes": {
"smithy.example#MyOperation": {
"type": "operation",
Expand Down
40 changes: 27 additions & 13 deletions 2.0/_sources/aws/rules-engine/auth-schemes.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,12 @@ make it possible to validate configurations for AWS authentication schemes like
`AWS signature version 4`_. An additional dependency is required to access
these validators

The following example adds ``smithy-aws-endpoints`` as a Gradle dependency
to a Smithy project:
The following example adds ``smithy-aws-endpoints`` as a dependency to a Smithy project:

.. tab:: Gradle

.. code-block:: kotlin
dependencies {
...
implementation("software.amazon.smithy:smithy-aws-endpoints:__smithy_version__")
...
}
.. tab:: smithy-build.json
.. tab:: Smithy CLI

.. code-block:: json
:caption: smithy-build.json
{
"maven": {
Expand All @@ -34,6 +24,30 @@ to a Smithy project:
}
}
.. tab:: Gradle

.. tab:: Kotlin

.. code-block:: kotlin
:caption: build.gradle.kts
dependencies {
...
implementation("software.amazon.smithy:smithy-aws-endpoints:__smithy_version__")
...
}
.. tab:: Groovy

.. code-block:: groovy
:caption: build.gradle
dependencies {
...
implementation 'software.amazon.smithy:smithy-aws-endpoints:__smithy_version__'
...
}
.. _rules-engine-aws-authscheme-validator-sigv4:

-----------------------------------------
Expand Down
36 changes: 25 additions & 11 deletions 2.0/_sources/aws/rules-engine/built-ins.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,10 @@ dependency is required to access these functions:
The following example adds ``smithy-aws-endpoints`` as a Gradle dependency
to a Smithy project:

.. tab:: Gradle

.. code-block:: kotlin
dependencies {
...
implementation("software.amazon.smithy:smithy-aws-endpoints:__smithy_version__")
...
}
.. tab:: smithy-build.json
.. tab:: Smithy CLI

.. code-block:: json
:caption: smithy-build.json
{
"maven": {
Expand All @@ -33,6 +24,29 @@ to a Smithy project:
}
}
.. tab:: Gradle

.. tab:: Kotlin

.. code-block:: kotlin
:caption: build.gradle.kts
dependencies {
...
implementation("software.amazon.smithy:smithy-aws-endpoints:__smithy_version__")
...
}
.. tab:: Groovy

.. code-block:: groovy
:caption: build.gradle
dependencies {
...
implementation 'software.amazon.smithy:smithy-aws-endpoints:__smithy_version__'
...
}
.. _rules-engine-aws-built-ins-region:

Expand Down
39 changes: 27 additions & 12 deletions 2.0/_sources/aws/rules-engine/library-functions.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,13 @@ make it possible to integrate AWS concepts like `Amazon Resource Names (ARNs)`_
and `Partitions`_. An additional dependency is required to access these
functions:

The following example adds ``smithy-aws-endpoints`` as a Gradle dependency
The following example adds ``smithy-aws-endpoints`` as a dependency
to a Smithy project:

.. tab:: Gradle

.. code-block:: kotlin
dependencies {
...
implementation("software.amazon.smithy:smithy-aws-endpoints:__smithy_version__")
...
}
.. tab:: smithy-build.json
.. tab:: Smithy CLI

.. code-block:: json
:caption: smithy-build.json
{
"maven": {
Expand All @@ -34,6 +25,30 @@ to a Smithy project:
}
}
.. tab:: Gradle

.. tab:: Kotlin

.. code-block:: kotlin
:caption: build.gradle.kts
dependencies {
...
implementation("software.amazon.smithy:smithy-aws-endpoints:__smithy_version__")
...
}
.. tab:: Groovy

.. code-block:: groovy
:caption: build.gradle
dependencies {
...
implementation 'software.amazon.smithy:smithy-aws-endpoints:__smithy_version__'
...
}
.. _rules-engine-aws-library-awsPartition:

``aws.partition`` function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Smithy code generators are configured using plugins defined in
smithy-build.json files. For example:

.. code-block:: json
:caption: smithy-build.json
:emphasize-lines: 4-9
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ Interfaces (SPI).
Consider the following smithy-build.json file:

.. code-block:: json
:caption: smithy-build.json
{
{
"version": "1.0",
"plugins": {
"foo-client-codegen": {
Expand All @@ -36,7 +37,7 @@ Consider the following smithy-build.json file:
"edition": "2022"
}
}
}
}
This file tells Smithy-Build to generate a hypothetical Foo language
client using the ``foo-client-codegen`` plugin found on the classpath.
Expand Down Expand Up @@ -149,8 +150,9 @@ implementation. For example, here's how service code generation could be
configured for a Java code generator:

.. code-block:: json
:caption: smithy-build.json
{
{
"version": "1.0",
"projections": {
"source": {
Expand All @@ -164,7 +166,7 @@ configured for a Java code generator:
}
}
}
}
}
Client generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ your project.
plugins {
- id("software.amazon.smithy").version("0.7.0")
+ `java`
+ id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
+ id("software.amazon.smithy.gradle.smithy-jar").version("__smithy_gradle_version__")
}
.. tab:: Groovy
Expand All @@ -45,7 +45,7 @@ your project.
plugins {
- id 'software.amazon.smithy' version '0.7.0'
+ id 'java'
+ id 'software.amazon.smithy.gradle.smithy-jar' version '0.10.0'
+ id 'software.amazon.smithy.gradle.smithy-jar' version '__smithy_gradle_version__'
}
Remove Buildscript Dependencies
Expand Down
12 changes: 6 additions & 6 deletions 2.0/_sources/guides/gradle-plugin/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The following example configures a project to use the ``smithy-base`` Gradle plu
:caption: build.gradle.kts
plugins {
id("software.amazon.smithy.gradle.smithy-base").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-base").version("__smithy_gradle_version__")
}
.. tab:: Groovy
Expand All @@ -60,7 +60,7 @@ The following example configures a project to use the ``smithy-base`` Gradle plu
:caption: build.gradle
plugins {
id 'software.amazon.smithy.gradle.smithy-base' version '0.10.0'
id 'software.amazon.smithy.gradle.smithy-base' version '__smithy_gradle_version__'
}
Expand Down Expand Up @@ -124,7 +124,7 @@ The following example ``build.gradle.kts`` will build a Smithy model using a
plugins {
`java-library`
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-jar").version("__smithy_gradle_version__")
}
// The SmithyExtension is used to customize the build. This example
Expand Down Expand Up @@ -152,7 +152,7 @@ The following example ``build.gradle.kts`` will build a Smithy model using a
plugins {
id 'java-library'
'software.amazon.smithy.gradle.smithy-jar' version '0.10.0'
'software.amazon.smithy.gradle.smithy-jar' version '__smithy_gradle_version__'
}
// The SmithyExtension is used to customize the build. This example
Expand Down Expand Up @@ -198,7 +198,7 @@ build using the "external" projection.
plugins {
`java-library`
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-jar").version("__smithy_gradle_version__")
}
repositories {
Expand Down Expand Up @@ -231,7 +231,7 @@ build using the "external" projection.
plugins {
id 'java-library'
id 'software.amazon.smithy.gradle.smithy-jar' version '0.10.0'
id 'software.amazon.smithy.gradle.smithy-jar' version '__smithy_gradle_version__'
}
repositories {
Expand Down
44 changes: 37 additions & 7 deletions 2.0/_sources/guides/model-linters.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,45 @@ that is configurable. Linter implementations are found in code. The
`smithy-linters`_ package in Maven Central contains several linters that
can be used to apply additional validation to Smithy models.

The following example adds ``smithy-linters`` as a Gradle dependency
to a ``build.gradle.kts`` file:
The following example adds ``smithy-linters`` as a dependency to a Smithy project:

.. code-block:: kotlin
.. tab:: Smithy CLI

.. code-block:: json
:caption: smithy-build.json
{
"...": "...",
"maven": {
"dependencies": [
"software.amazon.smithy:smithy-linters:__smithy_version__"
]
},
"...": "..."
}
.. tab:: Gradle

.. tab:: Kotlin

.. code-block:: kotlin
:caption: build.gradle.kts
dependencies {
...
implementation("software.amazon.smithy:smithy-linters:__smithy_version__")
}
.. tab:: Groovy

.. code-block:: groovy
:caption: build.gradle
dependencies {
...
implementation 'software.amazon.smithy:smithy-linters:__smithy_version__'
}
dependencies {
implementation("software.amazon.smithy:smithy-model:__smithy_version__")
implementation("software.amazon.smithy:smithy-linters:__smithy_version__")
}
After the dependency is added and available on the Java classpath, validators
defined in the package and registered using `Java SPI`_ are available for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ OpenAPI specifications from Smithy models.
java
// Use the `smithy-jar` plugin if you also want to package
// smithy models into the JAR created by the `java` plugin.
id("software.amazon.smithy-base").version("0.10.0")
id("software.amazon.smithy-base").version("__smithy_gradle_version__")
}
dependencies {
Expand All @@ -184,7 +184,7 @@ OpenAPI specifications from Smithy models.
id 'java'
// Use the `smithy-jar` plugin if you also want to package
// smithy models into the JAR created by the `java` plugin.
id 'software.amazon.smithy-base' version '0.10.0'
id 'software.amazon.smithy-base' version '__smithy_gradle_version__'
}
dependencies {
Expand Down Expand Up @@ -1245,7 +1245,7 @@ of a Smithy model into an OpenAPI specification.
plugins {
java
id("software.amazon.smithy.gradle.smithy-base").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-base").version("__smithy_gradle_version__")
}
dependencies {
Expand All @@ -1263,7 +1263,7 @@ of a Smithy model into an OpenAPI specification.
plugins {
id 'java'
id 'software.amazon.smithy.gradle.smithy-base' version '0.10.0'
id 'software.amazon.smithy.gradle.smithy-base' version '__smithy_gradle_version__'
}
dependencies {
Expand Down
Loading

0 comments on commit 4a820f8

Please sign in to comment.