Commit Graph

1153 Commits

Author SHA1 Message Date
JordonPhillips 8c7094fb37 Use team for CODEOWNERS file
This updates the codeowners config to use a team so we don't have
to keep chaning this file.
2021-09-14 14:35:40 -07:00
JordonPhillips 3b6052befe Fix misconfigured malformed request tests 2021-09-14 19:02:45 +02:00
JordonPhillips fdf5340a13 Add more base64 malformed request tests
This adds more base64 tests, including ones for strings that use
mediaType in places where they need to be encoded.
2021-09-14 14:52:45 +02:00
Michael Dowling bc8939b20c Revert "Add removeUriPrefix to OpenAPI converter"
This reverts commit 2e1cdc4af7.

We decided that while this is a good short-term solution for teams that
include a stage or a kind of prefix in their API routes, it won't be a good
solution for really anyone in the long-term once Smithy clients and AWS
SDKs can all resolve endpoints that contain a base path for every
operation. Rather than add this option now and have to deprecate it
later or add competing guidance on how to properly do this, let's
revert. This feature was never released, and we can always add it back
later if we need to change our approach for any reason.
2021-09-13 11:51:29 -07:00
Michael Dowling 2e1cdc4af7 Add removeUriPrefix to OpenAPI converter 2021-09-08 13:31:59 +02:00
John DiSanti 5112fddc64 Simplify type replacement validation logic
Co-authored-by: Jordon Phillips <JordonPhillips@users.noreply.github.com>
2021-09-02 16:00:20 +02:00
John DiSanti fe83c5e32a Allow replacement of simple shape types in ModelTransformer 2021-09-02 16:00:20 +02:00
David Oguns 774272346b
Added scheme property to HttpApiKeyAuth trait (#893)
Add scheme property to HttpApiKeyAuth trait
2021-09-01 10:57:56 -07:00
Adam Thomas d40493280f Fix escaping in malformed request test
In attempting to test rejection of a named timezone in a path parameter,
[Europe/Paris], the slash was accidentally left unencoded, which turned
it into a test of the URI matcher, instead of the timestamp deserializer.
2021-09-01 09:07:10 -07:00
AllanZhengYP 9895377e29 add test for rpc protocol path prefix 2021-08-31 09:14:08 -07:00
Adam Thomas a9a46d2f9e Add protocol tests for validation 2021-08-25 10:51:41 -07:00
JordonPhillips a239b87a70 Move accept/content-type tests 2021-08-24 12:40:43 +02:00
JordonPhillips c0691154bf Add David to codeowners 2021-08-23 17:07:49 +02:00
Michael Dowling 30d9547b74 Update semantic validation of OPTIONS
* OPTIONS do support payloads
* OPTIONS should rarely, if ever, be modeled. They should instead just
  be implementation details of how CORS works.
2021-08-17 17:01:37 -07:00
Michael Dowling 14d19d0647 Clarify that event streams contain modeled errors 2021-08-16 10:17:08 -07:00
Michael Dowling 562a88e4d7 Add mutli-character newlines support in CodeWriter
CodeWriter now support multi-character newlines like '\r\n'.
2021-08-16 09:18:26 -07:00
JordonPhillips 6084e16123 Make sets ordered 2021-08-16 17:33:48 +02:00
kstich 28faa492ba Add error support to examples trait
This commit adds the ability to specify an error in the examples
trait. The error specified must be bound to the operation the trait
is applied to.
2021-08-12 11:59:57 -07:00
JordonPhillips 9cfa3285b1 Allow accept to be the default document content type 2021-08-11 14:42:19 +02:00
JordonPhillips 768d9dd112 Add malformed content-type / accept tests 2021-08-11 14:42:19 +02:00
JordonPhillips 2abc085fb6 Add index of all traits
This add an index of all existing traits to the specifications page.
This makes it way easier to find the docs for a trait you know about
without having to figure out what class of trait it is, or whether
it lives in aws or somewhere else.
2021-08-10 15:06:52 +02:00
Adam Thomas faa689b2ed Malformed request tests for timestamps 2021-08-09 10:03:12 -07:00
Jaykumar Gosar 28182a99f1 Add note about structurally exclusive for httpQueryParams 2021-08-09 12:26:14 +02:00
Adam Thomas 8d5fb4483e Some initial malformed request tests 2021-08-05 14:38:21 -07:00
Trivikram Kamat 23ab7d4530 fix(docs): httpChecksum.response should be a list 2021-08-03 15:23:46 -07:00
kstich b6e49a0a41 Bump version to 1.11.0 2021-08-03 13:54:58 -07:00
Adam Thomas bdc32a200a Anchor the id pattern for HTTP protocol tests 2021-08-03 13:44:35 -07:00
Adam Thomas 745521417e Initial implementation of @httpMalformedRequestTests
Sets up the trait and serialization/deserialization of all of its members. This
trait allows server implementations to generate tests that reject invalid
requests before those requests are bound to a Smithy-generated implementation
class, or before the deserialized request is handed off to application code.
2021-08-03 13:44:35 -07:00
JordonPhillips 7f7ea9809c Add local tests for openapi protocol headers 2021-08-03 11:29:23 +02:00
JordonPhillips 64477cb0be Add checksum headers to openapi representation
This updates the openapi request/response header lists to account for
the various http checksum traits.
2021-08-03 11:29:23 +02:00
JordonPhillips f84d7bc961 Update headers for sigv4 and restJson1 for apig
This updates the lists of headers needed for sigv4 and for the
restJson1 protocol in the openapi conversion. It also ensures
that those headers are added to cors configurations for apig.
2021-08-03 11:29:23 +02:00
kstich 2a06d21907 Update EntityShape docs for clarity of use 2021-08-02 10:13:11 -07:00
Ian Smith Botsford 08c827aeb3 Clarify meaning of 'inserted' to be 'inserted before the end of the list of existing values' 2021-08-02 09:48:57 -07:00
Ian Smith Botsford cc9ce60998 Flag enum insertions as errors
When calculating Smithy diffs, enum value insertions should be flagged
as errors because they can cause backwards incompatibility concerns when
enum ordinals are used for iterating, serialization, etc. Enum values
appended to the end of the existing set of values should not be errors.
2021-08-02 09:48:57 -07:00
Ken Gilmer 255cf3f901 Fix wording of sentence describing enheritance behavior of auth trait from service to operation. 2021-07-26 12:05:22 -07:00
Aaron J Todd 6ab6243284 add httpChecksumRequired test 2021-07-26 17:22:42 +02:00
Jaykumar Gosar 20e4eea2a8 Undo changes to createNode for Traits that used NodeMapper
They are fixed via https://github.com/awslabs/smithy/pull/865
2021-07-21 12:13:49 +02:00
Jaykumar Gosar 4b9a307ac6 Remove TODO for sourceLocation in createTrait related to NodeMapper
Those cases will be fixed with https://github.com/awslabs/smithy/pull/865
2021-07-21 12:13:49 +02:00
Jaykumar Gosar e6bf270479 Fix createTrait to carry forward the sourceLocation
Most existing createTrait methods do this, but these ones were missing
that logic.
2021-07-21 12:13:49 +02:00
Jaykumar Gosar c1783f14c6 Fix createNode to carry forward the sourceLocation
Most existing createNode methods do this, but these ones were missing
that logic.
2021-07-21 12:13:49 +02:00
Jaykumar Gosar 32fbace531 Fix toBuilder to carry forward the sourceLocation
Most existing toBuilders do this, but these ones were missing that
logic.
2021-07-21 12:13:49 +02:00
Jaykumar Gosar 9b4de14a5c Fix sourceLocation propagation in RetryableTrait 2021-07-21 12:13:49 +02:00
Jordon Phillips 4a6814471b
Update NodeMapper to handle Trait sourceLocation (#865)
* Update NodeMapper to handle Trait sourceLocation

This updates NodeMapper so that it can properly set source location
on traits that use the AbstractTraitBuilder. Unfortunately the fix
implemented here is a hack that looks for that specific case, and
the same root cause may bite us elsewhere.

The true root cause is that our default deserializer is unable to
resolve generics. AbstractTraitBuilder generically defines the
return value of the setter `sourceLocation` to `B extends
AbstractTraitBuilder`. When we use reflection to look at the return
type, all we see is `AbstractTraitBuilder`. We *can* also get the
type variable, but actually resolving it will take a decent amount
of effort as that functionality isn't built in.

* Make NodeMapper pass along source location

This updates the serializer for NodeMapper to pass along the
source location.

* Check if builder return type is self-assignable

This updates the builder detection in the node deserializer to check
to see if the builder type is assignable to a given method's return
type. This removes the need for a hack enabling source location, but
it's still not perfect. Ideally we should attempt to resolve any
generic return types.
2021-07-19 12:53:04 -07:00
kstich ae3af5e976 Remove warning when PATCH is idempotent 2021-07-19 08:10:12 -07:00
Jonathan Galperin cf1ecbd0dd
Update copyright year on docs website 2021-07-19 10:25:15 -04:00
Russell Cohen 3277a9758f Add protocol tests covering whitespace serialization/deserialization behavior 2021-07-19 12:33:37 +02:00
JordonPhillips 28d8df9a32 Fix version number 2021-07-14 19:40:16 +02:00
JordonPhillips 31403fc3fd Bump version to 1.10.0 2021-07-14 19:07:23 +02:00
Adam Thomas 49d8e3e795 Adjust query string parameter tests for servers
On the server side, @httpQueryParams holds all of the query parameter values
in the request, so if any of the query parameters has a list value, then
@httpQueryParams must target a map with a list value, otherwise a 400 will be
thrown during deserialization, instead of discarding excess query param values.
2021-07-14 18:48:45 +02:00
JordonPhillips c47bbdbcd9 Move checksum dupe checking to validator 2021-07-14 18:37:36 +02:00