1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
/// Whether a structure has an `@httpPayload` member that supplies its own body
/// framing, ex: a member carrying `@httpPayload` whose target is a
/// `structure` or a `union`.
///
/// # Why this is a hint and not a fact
///
/// The HTTP binding protocol needs this answer on every request, and deriving
/// it means scanning the input schema's members. Codegen already knows the
/// answer, so it records it here and the runtime reads it instead of scanning.
///
/// [`Unknown`](PayloadHint::Unknown) is the default, and the runtime falls back
/// to scanning when it sees it. That fallback is permanent, not
/// transitional. Two callers rely on it:
///
/// - schemas constructed by hand or materialized at runtime, which have no
/// codegen step to set the hint;
/// - generated crates produced *before* codegen began emitting the hint, which
/// Cargo permits to link against a newer `aws-smithy-schema` within the same
/// major version.
///
/// So this value must never become load-bearing for correctness. Anything that
/// consumes it has to produce identical output for `Unknown` by deriving the
/// answer itself.
///
/// # Why the framing question rather than the payload's shape
///
/// The variants deliberately answer "does a payload member frame the body?"
/// rather than describing the payload's type. `@httpPayload` may also target a
/// `blob`, `string`, or `document`, and those are not grouped together by the
/// runtime: blob and string payloads bypass the codec entirely (their bytes
/// become the body verbatim), while a document payload is written through the
/// codec. A variant named for one of those groupings would either be wrong or
/// would have to change meaning if a consumer for the distinction appeared.
///
/// The enum is `#[non_exhaustive]`, so a finer classification can be added
/// later without a breaking change.