3485a2e9cf
This commit removes the support for setting annotation traits to true because the previous rationale for supporting that no longer holds true. The previous rationale was that supporting `true` makes writing the AST JSON files easier. However, we've already crossed the point where we don't want humans writing the JSON AST, and we want it to be as easy to parse as possible. The AST format now requires that `{}` is provided for annotation traits. The IDL no longer supports setting a trait to `true` or `null`, as that was only supported in order to provide isomorphism with the AST support. We previously didn't persist which model format a pending trait definition came from, so it was necessary to give them the same feature set. However, now the Smithy loader maintains a boolean value that tells the loader whether or not a value is an "annotation", meaning trait with no value. This isn't a feature used in the AST loader, but is used in the IDL loader. Further, the BooleanTrait abstract class was renamed to AnnotationTrait. This is something I wanted to do for a long time, but never did since it would cause so much churn, and the name wasn't that far off from what it represents. However, now that `true` isn't supported for annotation traits, the name BooleanTrait makes no sense. This commit renames it and takes the BC hit because it's now worth it. |
||
---|---|---|
.github | ||
config | ||
docs | ||
gradle/wrapper | ||
smithy-aws-apigateway-openapi | ||
smithy-aws-apigateway-traits | ||
smithy-aws-iam-traits | ||
smithy-aws-protocol-tests | ||
smithy-aws-traits | ||
smithy-build | ||
smithy-cli | ||
smithy-codegen-core | ||
smithy-diff | ||
smithy-jsonschema | ||
smithy-linters | ||
smithy-model | ||
smithy-mqtt-traits | ||
smithy-openapi | ||
smithy-protocol-test-traits | ||
smithy-utils | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
NOTICE | ||
README.md | ||
build.gradle.kts | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
mkdocs | ||
settings.gradle.kts |
README.md
Smithy
Smithy is a protocol-agnostic interface definition language and set of tools for generating clients, servers, and documentation for any programming language.
NOTE: Smithy is a developer preview; we will continue to provide updates with new features, integrations, and fixes.
Modeling in Smithy
Smithy models define a service as a collection of resources, operations, and shapes.
namespace example.weather
service Weather {
version: "2006-03-01",
resources: [City],
operations: [GetCurrentTime]
}
resource City {
identifiers: { cityId: CityId },
read: GetCity,
list: ListCities,
resources: [Forecast],
}
// See the full example at https://awslabs.github.io/smithy/quickstart.html#complete-example
Find out more about modeling a service with Smithy in the Quick Start guide.
Building Smithy models
The Smithy Gradle Plugin is the best way to get started with building a
Smithy model. First, create a smithy-build.json
file:
{
"version": "1.0"
}
Then, apply the Smithy Gradle Plugin in your build.gradle.kts
file and run
gradle build
:
plugins {
id("software.amazon.smithy").version("0.4.3")
}
Find out more about building artifacts of your Smithy model in the Building Smithy Models guide.
License
This library is licensed under the Apache 2.0 License.