* Allow `@required` with `@httpPrefixHeaders`
The server generates members with `@required` and `@httpPrefixHeaders` as if
they were always optional. This commit allows the correct generation with `@required`.
Closes: #1394
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* Correctly generate http response codes
http response codes will be:
* `@httpResponseCode` if set
* `@http`'s code, if `@httpResponseCode` is not set
* the default one, if neither of the above are set
@httpResponseCode honors @required and generates code that
doesn't use Option when applied.
Closes: #1229
The server must have the most up to date variants and the unknown enum
variant should not be used. Clients are generated with it because they
might not have the most recent model and the server might return
an unknown variant to them.
Closes#1187
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Co-authored-by: Daniele Ahmed <ahmeddan@amazon.de>
Co-authored-by: david-perez <d@vidp.dev>
Co-authored-by: Matteo Bigoi <1781140+crisidev@users.noreply.github.com>
Instead of fabricating a new service shape when the caller does not
explicitly provide one, first attempt to obtain one from the passed in
model, which is a more faithful test code generation context.
Generate crates using Rust 2021 instead of Rust 2018
Remove use std::convert::TryFrom which is in the prelude
Closes#1332
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
This change removes the dependency on axum-core and brings in the
relevant resources we are using from that crate.
Issue: #1170
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
* add: offset setter to FsBuilder
remove: file_size setter from FsBuilder
add: length setter to FsBuilder
add: test for ByteStream w/ offset
add: test for ByteStream w/ length less than file size
update: path_based_bytestreams_with_builder test
* add: test ensuring offset and length work correctly together
add: test ensuring that no data is returned when offset is greater than file size
add: test ensuring that nothing breaks if length to read is larger than file size
* add: chunking test
add: CHANGELOG.next.toml entry
refactor: new code based on PR comments
* remove: unused use statement
* refactor: length API
* update: prefer unwrap() to returning error in tests
* update: prefer unwrap() to returning error in tests
add: test for Length::Exact behavior
* update: error if offset is greater than file length
* fix: test to work with new offset error
* update: error test to be more specific
* Add command line arguments for server and port. Default the bind address to localhost
* Update rust-runtime/aws-smithy-http-server/examples/pokemon_service/src/main.rs
* Remove tracing::instrument as we should create the spans inside the code generated code
Co-authored-by: david-perez <d@vidp.dev>
* in-progress draft of features RFC
* add: info on default feature functionality change
* Update design/src/rfcs/rfc0009_using_features_responsibly.md
Co-authored-by: Russell Cohen <rcoh@amazon.com>
* rename: RFC filename
add: rfc to summary page
remove: TODO section
* update: design summary ToC
remove: default feature example
* fix: RFC numbers in SUMMARY ToC
* fix: bad link
Co-authored-by: Russell Cohen <rcoh@amazon.com>
The `acquire-build-image` script was coded up with the assumption that
it would only work with x86_64 build images. This commit revises that
script and the `Dockerfile` to correctly work on ARM64 architectures as
well.
* fix: Silence home directory warning in Lambda Extensions
This PR follows on to https://github.com/awslabs/smithy-rs/pull/893 which added
LAMBDA_TASK_ROOT check. When running as a [Lambda Extension][ext]
the environment variable for TASK_ROOT is redacted, so it is not
reliable for testing whether you are in Lambda.
Related commit: fbb4bc
[ext]: https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html
* update changelog
* fixup: use AWS_LAMBDA_FUNCTION_NAME which is available in both environments
* Update CHANGELOG.next.toml
* Fix failing unit test
Co-authored-by: John DiSanti <jdisanti@amazon.com>
On M1 Macs, Gradle's working directory is the path of the Gradle daemon
rather than the project root. The SDK's `IntegrationTestDecorator` was
assuming that the working directory would always be the project root, so
assemble was failing on this setup.
This commit adds SDK-specific settings so that the integration test
directory can be configured in `smithy-build.json`.