Commit Graph

1741 Commits

Author SHA1 Message Date
Chase Coalwell f53ffd52f0
publish docs via ssh (#1503) 2022-11-17 17:01:05 -07:00
Chase Coalwell 87d12179f5 Amend changelog for 1.26.3 2022-11-16 14:30:17 -08:00
Chase Coalwell 59144e631e
Bump version to 1.26.3 (#1498) 2022-11-16 14:56:44 -07:00
JordonPhillips f19dfb1290 Update links to point to smithy.io 2022-11-15 18:11:04 +01:00
Michael Dowling c8ddd37128 Fix docs and fail on nitpicky doc warnings
This commit fixes docs so that they don't emit warnings
and will now fail doc builds on nitpicky documentation
warnings.
2022-11-15 07:02:10 -08:00
rchache 6b7e154588
Sensitive validator branch (#1364)
Validator for missing sensitive trait
2022-11-14 16:18:07 -08:00
Hayden Baker c226a57ff0
Update protocol tests with int enum coverage (#1492)
* Add coverage for `intEnum` in all protocol tests

As part of IDL 2.0, the `intEnum` shape was added. The following changes
add several test cases using an `intEnum` shape (and/or aggregates)
under the `awsJson1_*`, *Query, and `RestXml` protocol test suites.
2022-11-14 10:38:13 -08:00
JordonPhillips 33fe7b1e64 Add useIntegerType cfn docs 2022-11-14 19:34:35 +01:00
JordonPhillips ca32f6934d Move useIntegerType to jsonschema
The integer type is a sort of vaugely supported thing in json schema,
not jsut OpenAPI. So this moves that configuration up to the generic
settings so it can also be applied to cloudformation and any future
derivative tooling.

The int32 / int64 formats were kept to openapi since that *isn't*
referenced in the the json schema spec.
2022-11-14 19:34:35 +01:00
Paul Colby c6ed7aefc6
Correct the Resource shape properties Type entry (#1415)
* Correct a minor grammar mistake

* Correct the Resource shape properties Type entry

Prior to this change, the docs incorrectly list the Type as
"AST shape reference", but as per the Description column, and the
Model (not AST) docs, as well as the Introducing Smithy IDL 2.0
blog post, this Type should be a map of strings to shape ID.

See:
* https://awslabs.github.io/smithy/2.0/spec/service-types.html#resource
* https://awslabs.github.io/smithy/2.0/spec/json-ast.html#resource-shape
* https://aws.amazon.com/blogs/developer/introducing-smithy-idl-2-0/

* Correct the Resource shape's `properties` type

It should be a map of AST shape references, as per
https://github.com/awslabs/smithy/pull/1415#discussion_r1018609584
2022-11-14 08:47:09 -08:00
Hayden Baker a8fd6c537d
Fix cfn-mutability for inherited identifiers (#1465)
* Fix cfn-mutability for inherited identifiers

For resources with parent resources, identifiers that are inherited
should be marked with create-and-read mutability instead of the
defaults for that resource. This fixes that case, and adjusts the
test cases to verify the correct behavior
2022-11-10 14:28:20 -08:00
Ian Smith Botsford f12a7370fe Update new protocol tests to use shared types instead 2022-11-10 13:35:51 +01:00
Ian Smith Botsford 206a1ea2dd Add protocol tests of timestampFormat on target shapes 2022-11-10 13:35:51 +01:00
82marbag 040cabae57
Protocol tests applied to the wrong operations (#1477)
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
2022-11-09 13:12:17 -08:00
Adam Thomas 17cee29c30 Minor fix to AbstractCodeWriter documentation
The example for $C did not compile.
2022-11-08 15:03:05 -08:00
dependabot[bot] c68b6b6bf2
Bump actions/setup-java from 1 to 3 (#1483)
* Bump actions/setup-java from 1 to 3

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 1 to 3.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add distribution to codeguru-reviewer workflow

* Update java-version in codeguru-reviewer workflow to Java 8

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Steven Yuan <yuasteve@amazon.com>
2022-11-08 11:09:05 -08:00
JordonPhillips 77bd4d8e9f Bump version to 1.26.2 2022-11-08 15:13:33 +01:00
Alex Woods 3f8cdeb084 Add missing regions and fix typo in partitions.json 2022-11-07 08:35:39 -08:00
dependabot[bot] 60bafd3793 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 17:39:02 -07:00
dependabot[bot] a8af647032 Bump github/codeql-action from 1 to 2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 17:38:38 -07:00
dependabot[bot] 7eff36319b Bump actions/setup-python from 2 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 17:38:16 -07:00
dependabot[bot] a4726a55a3 Bump actions/upload-artifact from 2 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 17:37:51 -07:00
James ae00ecd75c Add dependabot updates for dependencies in GitHub Actions workflows 2022-11-01 12:36:35 -07:00
Kevin Stich f42ce863b0
Bump version to 1.26.1 (#1476) 2022-10-31 12:51:02 -07:00
Manuel Sugawara 715b1d94ab
Reverse the logic of protocol tests for aws and ec2 query for empty lists (#1444)
Currently both aws query and ec2 query do serialize empty lists
2022-10-28 16:15:10 -07:00
kstich d8185ac6ea Lower resource identifier collisions to warning
This commit updates the validation for resource identifier collisions
to warn instead of error. When an explicit and implicit binding for
the same resource identifier are found, the explicit binding is
preferred.
2022-10-28 15:55:42 -07:00
Michael Dowling c6ac19655b Add support for hierarchical event IDs
Many of the validators in Smithy and Smithy Diff today emit events for
various reasons. A single validator might event different events with
different severities, and there is currently no way to suppress just
one specific type of event for a given validator. For example, the
ChangedNullability SmithyDiff validator emits events for various reasons,
some of which different tools may choose to suppress. However, without
inspecting the message of the event, there's no way to know what you're
suppressing.

To give existing validators the ability to emit more granular validation
events without breaking current validators, this change introduces
event ID hierarchies and hierarchical suppression IDs using dots (.).
For example, ChangedNullability.RemovedRequiredTrait is now emitted, and
tools can check for "ChangedNullability" to match all events, or more
granularly only match "ChangedNullability.RemovedRequiredTrait". This
can also be used in suppressions so that existing Smithy validators can
be updated to emit more granular events.
2022-10-27 15:43:11 -07:00
Julian Antonielli 67af34b1c9 Fix `@httpMalformedRequestTests` being applied to the wrong operation 2022-10-27 13:03:21 -07:00
Richard Hernandez 58a8eb818d Fix dead link to RFC3339 2022-10-27 10:51:52 -07:00
JordonPhillips 96882ea7af Add custom codegen hook before shape generation
Some languages need to generate code before shapes are generated.
Previously such languages could have used the service generation hook
to perform this, but that was moved to occur after generating the
other shapes.
2022-10-27 12:41:12 +02:00
Çağla Burcu ALOĞLU beeea1f1de
Update aws-core.rst (#1470)
Fix code snippet in aws.api#dataPlane trait documentation
2022-10-26 08:02:06 -06:00
kstich b0dced3cf0 Warn on unknown trait diffs
In smithy-diff, traits that have `diff` tags applied to their
definitions can be properly evaluated on modification. However,
it is possible for models to be loaded without trait definitions,
meaning no diff evaluation occurs. This commit updates the
ModifiedTrait evaluator to emit events when a trait without a
definition is not constant across the compared models.
2022-10-25 15:21:52 -07:00
Weihang Lo 3aed0564c4 Add more `X-Amz-Target` for AMS JSON 1.1 protocol tests 2022-10-25 15:04:38 -07:00
Weihang Lo 820518f59e Add `x-azm-target` for missing AWS JSON 1.1 tests
Signed-off-by: Weihang Lo <weihanglo@users.noreply.github.com>
2022-10-25 15:04:38 -07:00
Steven Yuan d1a8f397f9 Update identifier ABNF and parser
Previously, the ABNF did not match the identifier parser.

This commit updates the ABNF to match current parsing behavior, and
updates the identifier parser to avoid out of bounds exceptions.

Also, a set of tests are added for ONLY parsing identifiers rather
than being mixed with namespace tests.
2022-10-24 13:59:23 -07:00
Michael Dowling c079c9b3ee Add ability to lint based on word boundaries
This commit introduces a new syntax for matching words with the
ReservedWords linter and is intended to be used with the upcoming
sensitive words linter defined in #1364.

In addition to supporting wildcard searches ("*" prefix, suffix,
and contains), we now support matching based on word boundaries.

This commit introduces the "terms" keyword for word boundary
searches and adds dedicated abstractions for word boundary and
wildcard matching.

For example, "access key id" will match "AccessKeyId",
"access_key_id", "accessKeyID", "access_key_id100", "AccesKeyIDValue".
It will also match when all the words are concatenated together:
"accesskeyid". However, it will not match "accesskey_id" because it
only has two word boundaries ("accesskey" and "id").
2022-10-24 13:46:17 -07:00
Michael Dowling 8423ea6dea Remove unnecessary streamId from stream example
Addreses #1380
2022-10-24 09:26:05 -07:00
Michael Dowling 3a0d0233b2 Clarify streaming trait values and semantics
* Clarify that streaming trait members need httpPayload when using
  an http binding protocol.
* Clarify that servers should interpret streaming members as
  having a default value of zero bytes.
* Mention this in the v1 docs too.
* Fixed a doc linking issue for the streaming docs where we were
  using the wrong casing.

Closes #1380
Addresses #1456
2022-10-21 19:00:16 -07:00
Michael Dowling 8beb77af9e Correct precedence in NullableIndex and fix diffs
Smithy-Diff was flagging acceptable changes of removing `@default(null)` from
member when the trait had no effect because the target shape was already nullable.
NullableIndex was also giving the `@default(null)` trait precedence over the
`@required` trait which is incorrect. Required members are non-nullable, and
the `@default(null)` trait doesn't override this. It simply means that there is
no default value for the member (so coupled with the required trait, the member
is still always present).
2022-10-21 15:12:48 -07:00
kstich 82ffb37fae Fix dropping doc comments after default values
This commit fixes an issue where documentation comments were dropped
for members that follow a member with a default value. Pending docs
are only cleared when a default isn't encountered or the container
is complete.
2022-10-21 14:49:57 -07:00
Michael Dowling c45d5dbcc4 Remove pattern from suppress trait entries
The suppress trait contained a restrictive pattern trait that was
not present in validator ID definitions. This meant that validation
events could be suppressed in metadata suppressions (where there was
no pattern validation), but not using the `@suppress` trait. Adding
the pattern from the `@suppress` trait to validation event IDs at
this point has the potential to break existing models, so that is
not a desirable alternative.

Closes #987
2022-10-19 16:25:28 -07:00
Michael Dowling b130116c16 Improve ChangedNullability diff evaluator
This validator now does not emit trait change warnings when the required
trait is changed, and instead relies on ChangedNullability (this matches
how the box trait is handled too). When the required trait is removed
from a member that targets a structure or union, a warning is emitted
instead of an error to indicate that this is often allowed in Smithy
generators that treat these members as always nullable regardless of
the required trait.
2022-10-19 11:36:03 -07:00
Michael Dowling 6cc1ba41e5 Fix resource identifier collision and validation
When loading a model with multiple members bound to the same resource identifier,
Smithy failed with an error in IdentifierBindingIndex due to Collectors.toMap:

Duplicate key X (attempted merging values y and z)

This change updates IdentifierBindingIndex to ignore collisions. However this
means that colliding resource identifier bindings would be ignored (which is
arguably worse than failing to load the model since it wouldn't ever flag
these issues, and retroactively enforcing things is always challenging).
To address this, I added validation to detect when members with the
resourceIdentifier trait conflict with members of the same binding name
or members that have the same resourceIdentifier trait.
2022-10-18 16:03:24 -07:00
Michael Dowling de2e40605c Always attempt model interop transforms
We previously did not attempt to perform model interop transforms
if a model had errors. For example, if a model referred to an
unknown trait, the model wouldn't use the interop transformation.
Some use cases might choose to ignore unknown traits and other
errors by _not_ unwrapping the assembled model and instead
directly accessing the result from ValidatedResult. In these
cases, the model would have not gone through the interop transform,
resulting in an unexpect model (for example, if performing a diff
against a 1.0 and 2.0 model, the upgrade won't run and causes the
models to appear to be wildly different).
2022-10-18 16:02:56 -07:00
Ganesh Jangir 629d75bffb add test case 2022-10-18 16:02:25 -07:00
Ganesh Jangir 414ea994e2 expand imports 2022-10-18 16:02:25 -07:00
Ganesh Jangir 85505c8e27 fix line autochange 2022-10-18 16:02:25 -07:00
Ganesh Jangir eefbd78e34 clean unused imports 2022-10-18 16:02:25 -07:00
Ganesh Jangir dfec7e707b Implement toNode for partition models 2022-10-18 16:02:25 -07:00
JordonPhillips 63e43a99c8 Add more test cases for enum member removal 2022-10-17 16:51:36 +02:00